#Headings you can make levels of heading in Rmarkdown documents using hash.

One hash for big headings

Two hash for smaller headings

Three hash for even smaller headings

and so on…

Bold and italics

you can also make thisng bold and ital using asterisks on either side of the text. Use one for italic, two for bold

I want this to be bold

I want this to be italics

Bullet points

we can make bullet points with dashes. - bullet 1 - bullet 2

dont forget to put a space after the dash to get bullets

Quotes

get quotes using a “>” as a starter

“Insert a really inspiring quote here”

pictures, gifs, tweets

it’s pretty easy to embed all kinds of things in Rmarkdown documents.

Pictures

Use ‘’ make sure that it’s in the same folder as the html file

Tweets / Linkedin post

Use embed code from twitter to insert tweets. Since i don’t have twitter, i tried embedding linkedin post code and it works!

gifs

also use the embed code

What about code (or chunks in cool terms)?…

We can intersperse notes & code “chunks” Click “C+ Insert” and click ‘R’ from the dropdown menu. OR press ‘option + command + I’ for shortcut To run the code, press the green arrow on each chunk, OR press Cntrl+shift+enter.

load packages

to remove messages from codechunks that you don’t wanna show, click setting -> untick ‘show warnings’ and ‘show messages’

library(tidyverse)
library(readr)

read in the beaches data

beaches <- read_csv("cleanbeaches.csv")
beaches %>%
  group_by(site) %>%
  summarise(meanbugs = mean(beach_bugs, na.rm = TRUE)) %>%
  ggplot(aes(x = meanbugs, y = site)) +
  geom_col() +
  theme_classic() +
  labs (title = "Mean Bacteria Levels at Eastern Suburbs Beaches",
        subtitle = "Enter a cool subtitle here",
        caption = "Sources: NSW gov",
        x = "Mean levels",
        y = "Eastern Suburbs Beaches")

Exporting in other file format (PDF & Word)

the default is html, but we can export in other formats using the drop down in ‘knit’ botton. in practice, the word might be useful if you wanna showcase codes to your supervisor (although not sure why it doesnt show some of the output like graphs).

the pdf is more tricky as it depends on your computer processor (often it will gives error related to ‘LaTex’ installment).

lets try to instal ‘tinytex’ to see if this solves the problem (it doesnt…)

install.packages(“tinytex”) library(tinytex)