RMarkdown documents

rstudio
rmarkdown

Writing documents in RMarkdown

Author

Siobhon Egan

Published

February 13, 2021

🔗 Lets start with some of my favourite essential resources

If are a R Markdown newbie I suggest starting at the official lessons on R Markdown by R Studio.

Here is a presentation I have presented in the past to give you a give overview of using RMarkdown

INSTALL Just like the rest of R packages, get started with R Markdown by executing the following from the console

install.packages("rmarkdown")

Create a new RMarkdown document by selecting File > New File > R Markdown... > Document > HTML > Open This will open the default RMarkdown document that will knit to html, however you can change to PDF, word etc.

Templates

To get the most out of RMarkdown there are a number of various templates to suit whatever document and style you need. Below are some links to get you started.

🔗 General links on RMarkdown templates

Check out these examples here:

  • https://robertmitchellv.com/index.html
  • https://ulriklyngs.com/
  • https://github.com/svmiller?tab=repositories
  • https://github.com/ulyngs

Bookdown

CV

vitae, Nick Strayer package based on pagedown pagedown CVs another example from pagedown another example from pagedown

Articles

rticles

Thesis

Write your thesis with ease using Thesisdown and Oxforddown. Some extra links here and here.

Websites

Other themes

EpuRate

Posters

A new R package to make posters by Brent Thorne called posterdown

install.packages("posterdown")

Gnatt chart

Make gnatt chart into easy to read format by reading in csv.


Attaching package: 'ggplot2'
The following object is masked from 'package:crayon':

    %+%
library(readr)
# Load data
gnatt <-
  read_csv("gnatt.csv", col_types = cols(
    end = col_date(format = "%d/%m/%Y"),
    start = col_date(format = "%d/%m/%Y")
  ))

## Set factor level to order the activities on the plot

gnatt$chapter <- factor(gnatt$chapter)

plot_gnatt <- qplot(
  ymin = start,
  ymax = end,
  x = chapter,
  colour = activity,
  geom = "linerange",
  data = gnatt,
  size = I(5)
) +
  scale_colour_manual(values = c("red", "grey", "purple", "orange", "blue")) +
  coord_flip() +
  theme_bw() +
  theme(panel.grid = element_blank()) +
  xlab("") +
  ylab("") +
  ggtitle("Project planning")
plot_gnatt