R Markdown: So Fun

So fun

So, so fun

So, so, so fun

Today is a beautiful day to learn R Markdown. You can do things you can do in a word document like italics or italics and bold or bold.

You can also make pretty blockquote segments of text. You can have equations in the text. I would like to own 4 llamas.

Yep.

Okay then.

That is a lie, I would really like to own…

library(knitr)
library(rmarkdown)
library(markdown)
2^10 
## [1] 1024
x <- 2^10

llamas.

Capybaras are also awesome!

Other animals I like.

  1. pikas
  2. rodents in general
    +guinea pigs
    +hamsters

Code is evaluated.

happiness <- 1:5
llamas <- c(1,100,50,10,20)
plot(happiness, llamas, type="l")

Oops! forgot title! Don’t have to copy and paste images! Just change and knit.

happiness <- 1:5
llamas <- c(1,100,50,10,20)
plot(happiness, llamas, type="l", main="Perfect number of llamas for absolute happiness?")

But if you just want to show the output of the code:

Or just show the code:

happiness <- 1:5
llamas <- c(1,100,50,10,20)
plot(happiness, llamas, type="l", main="Perfect number of llamas for absolute happiness?")

You can also put these up on github! Automatically rendered, and can also see the raw code.

Publishing… ie. RPubs

Can make pdfs!

Can include urls:

https://github.com/minisciencegirl/studyGroup

Or a descriptive link:

R Study Group

You can include pictures!

well-dressed llama

llamas

You can make tables…

Llamas Alpacas
better underbites better haircuts

Future chunks dependent on previous chunks. dep_prev()

x
## [1] 1024

To generate a document without previewing it first: render(“Rmd demo.Rmd”, “pdf_document”)

There are also templates!