--- header-includes: \usepackage{mathtools} output: pdf_document: toc: false toc_depth: 3 includes: in_header: utils/header.tex # fig_caption: yes # the .bib files are to contain your references and your libraries use # these will be saved in report/utils/ bibliography: [utils/references.bib, utils/libraries.bib] link-citations: yes --- ```{r include=FALSE} # source functions or function directory R.utils::sourceDirectory(here::here("src", "functions")) # load libraries needed for report (or lead in scripts) pacman::p_load(knitr, rmarkdown) ``` ```{r include=FALSE} ## All content must be dynamic and not hard coded. You should assume that all ## objects are created with the code source()d here and do no exist otherwise. ## If the code sourced()d in this R Markdown files does not create what you need ## for your report, then the report cannot be replicated with new data (e.g., rows). ## DO NOT include anything that cannot be reproduced with your code source()d ## within the document. Any hard coding of paths, files, reference to objects, etc. ## will likely not work when reproduced. ## Note: source relevant .R scripts in order of operation for proper execution ## and replication/reproducibility; ensure that you have fetched collaborator ## branch content so that those file are local. As the last step, these will ## need to be on the main branch of the remote repo. I will test this with the ## main branch and with a data subset to ensure that the code reproduces appropriately ## raw data reading/cleaning/writing scripts(s) ## Ex: source(here::here("src", "data", "data-cleaning-xyz.R")) ## (if any) data summary/aggregation/writing scripts(s) (which depend on cleaned data) ## Ex: source(here::here("src", "data", "data-summary-mpg.R")) ## visualization scripts that create plots and save .pngs (which depend on data previous) ## Ex: source(here::here("src", "figs", "point_plot_mpg_by_wt.png.R")) ``` ```{r echo=FALSE} # some settings for figures in R Markdown # settings in code chunks will override these global settings knitr::opts_chunk$set(#fig.align = "center", fig.width = 12, fig.height = 8, fig.path = here::here("report", "figs"), echo = TRUE, warning = FALSE, message = FALSE ) ``` ```{r echo=FALSE,out.width="30%", fig.align='center'} # including a logo knitr::include_graphics(here::here("report", "images", "cmc-logo2.png")) ``` \centerline{} \centerline{} \centerline{} \centerline{\textbf{CMC Data Visualization: PSYC167}} \centerline{} \centerline{\textbf{Final Report for}} \centerline{\textit{Organization Name}} \centerline{} \centerline{} \centerline{\large \textbf{Project Title}} \centerline{} \centerline{} \centerline{Month, day, year} \centerline{} \centerline{} \centerline{\textbf{Team Members}} \centerline{Person A} \centerline{Person B} \centerline{Person C} \centerline{Person D} \centerline{} \centerline{} \centerline{\textbf{Project Advisor}} \centerline{Gabriel I. Cook} \centerline{} \centerline{\textbf{Liaison}} \centerline{Name} \centerline{} \centerline{} \centerline{} \centerline{\textbf{Code and Project Files}} \centerline{GitHub: } \newpage \centerline{\textbf{Abstract}} *Keywords*: \newpage \tableofcontents \newpage \centerline{\textbf{Acknowledgments}} \newpage ## **Introduction** Examples of citing references from the .bib file in utils/references.bib. Blah blah blah [@gill1980] for single citation Blah blah @gill1980 and @gill1980 [see also @gill1980, p.2]. In addition, [@anderson2015; @gill1980] say blah blah blah. [@gill1980; @anderson2015] multiple citation can be separated by semi-colon [-@gill1980] in order to suppress author name, and just display the year use a - [see @gill1980 p. 12; also this ref @anderson2015] is also valid Libraries can cite in text also. Blah blah @R-base, @R-knitr, @R-dplyr, and @R-ggplot2 ^[Footnote goes here] ## **Problem Statement** Blah blah ... ## **Data** ## *Sources* Blah blah ... ## *Characteristics* Blah blah ... ## *Data Quality and Preprocessing* Blah blah ... ## *Limitations* Blah blah ... ## **Findings** Blah blah ... If you want to add sub-sections, use the ### flag. ```{r echo=FALSE, out.width="80%", fig.align="center", fig.cap="A good caption for the plot."} ## example ##| echo: false # hide code ##| out.width: "80%" # resize based on width (if pixels, example out.width: "300px") ##| out.height: "70%" # resize based on height (if pixels, example out.height: "300px") ##| fig.align: "center" # align to center ##| fig.asp: 0.75 # aspect ratio ##| fig.width: 6 # figure width in inches ##| fig.height: 4 # figure height in inches ##| fig.cap: "A good caption" # when you need to include a plot, reference it by name at the location you want to insert it knitr::include_graphics(here::here("report", "figs", "point_plot_mpg_by_wt.png")) ``` ```{r echo=FALSE, out.width="60%", fig.align="center", fig.cap="A caption for a 60% width plot."} # example #| echo: false # hide code ##| out.width: "40%" # resize based on width (if pixels, example out.width: "300px") ##| out.height: "70%" # resize based on height (if pixels, example out.height: "300px") ##| fig.align: "center" # align to center ##| fig.asp: 0.75 # aspect ratio ##| fig.width: 6 # figure width in inches ##| fig.height: 4 # figure height in inches ##| fig.cap: "A good caption" # when you need to include a plot, reference it by name at the place of insert knitr::include_graphics(here::here("report", "figs", "point_plot_mpg_by_wt.png")) ``` ## **Discussion** Blah blah ... If you want to add sub-sections, use the ### flag. ## **Conclusion** Blah blah ... ## **Challenges and Limitations** Blah blah ... ```{r include=FALSE} # automatically create a bib database for R packages if (file.exists(here::here("report", "utils", "libraries.bib"))) { file.remove(here::here("report", "utils", "libraries.bib")) } # will build a libraries.bib file based on loaded libraries knitr::write_bib( x = c(.packages(), "knitr", "rmarkdown", "here"), file = here::here("report", "utils", "libraries.bib") ) ``` \newpage ## **References** \centerline{} \bibliographystyle{apacite}