Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
---
title: "Example R Markdown Report" #
author: Ian Cornelius # Sets the required information to generate a title page
date: January 2021 \newpage #
output:
bookdown::pdf_document2: # Sets the output of the file to PDF
includes:
in_header: latex_packages.tex # A LaTeX package MUST be used to use acronyms
bibliography: main.bib
csl: apa.csl
---
```{r load-packages, include=FALSE}
library(dplyr) # Required to use the %>% function
library(magrittr) # Required to use the %>% function
library(kableExtra) # Required to place the tables in the document in their correct location
```
[comment1]: <> (Creates the list of tables for any tables used)
\newpage
\listoftables
[comment2]: <> (% Creates the list of figures for any figures used)
\newpage
\listoffigures
[comment3]: <> (Creates the glossary list)
\newpage
\printnoidxglossaries
[comment4]: <> (Sample structure for a dissertation)
\newpage
# Introduction
`r lorem::ipsum(paragraphs = 2)`
[comment5]: <> ('lorem::ipsum' is being used to provide some default filler text)
[comment6]: <> (Example of using a sub-section within a section)
## Aims and Objectives
`r lorem::ipsum(paragraphs = 2)`
[comment7]: <> (Example of using a sub-sub-section within a sub-section)
### Motivation
`r lorem::ipsum(paragraphs = 2)`
\newpage
# Literature Review
`r lorem::ipsum(paragraphs = 2)`
\newpage
# Methodology
`r lorem::ipsum(paragraphs = 2)`
\newpage
# Implementation
`r lorem::ipsum(paragraphs = 2)`
\newpage
# Evaluation
`r lorem::ipsum(paragraphs = 2)`
\newpage
# Conclusion
`r lorem::ipsum(paragraphs = 2)`
[comment8]: <> (Example on how to use tables)
\newpage
# Table Example
Tables work a little differently in R Markdown, and I would always recommend using a CSV file to import your data. It make it easier when it comes to referencing the table.
The first table of this document is shown in Table \@ref(tab:table1).
```{r table1, echo=FALSE}
data <- read.csv("example_data.csv")
knitr::kable(data, caption = "The first table in this document.") %>%
kable_styling(latex_options = "hold_position") %>% row_spec(0,bold=TRUE)
```
[comment9]: <> (Example on how to use figures)
\newpage
# Figure Example
The first figure of this document is shown in Figure \@ref(fig:image1).
```{r image1, fig.align = 'center', out.width = "60%", fig.cap = "This is the first image in this document.", echo=FALSE}
knitr::include_graphics(here::here("placeholder_image.jpg"))
```
Whilst the second figure of this document is shown in Figure \@ref(fig:image2).
```{r image2, fig.align = 'center', out.width = "60%", fig.cap = "This is the second image in this document.", echo=FALSE}
knitr::include_graphics(here::here("placeholder_image.jpg"))
```
[comment10]: <> (Example on how to use acronyms. This is very similar to how it is done in LaTeX, in fact, it is LaTeX code. R Markdown does not have a function for this.)
\newpage
# Acronyms Example
At the beginning of this document I have defined some acronyms/initialisms. For example, when I want to refer to \gls{ai} it will first say the meaning and then provide the initials in brackets. Then whenever I mention \gls{ai} at a later point, it will always be referred to by its initialism.
[comment11]: <> (Example on how to use references)
\newpage
# Reference Example
Here I am introducing you all to the wonderful work that I did as a PhD student; that is
sarcasm [@Cornelius2017Dynamic]. But as @Cornelius2017Dynamic discuss in their work, it is pretty awesome; you should **check** \underline{it} *out*.
\newpage
# Bibliography