knitr::opts_chunk$set(collapse = TRUE)
R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
You can embed an R code chunk like this:
summary(cars)
fit <- lm(dist ~ speed, data = cars)
fit
Including Plots
You can also embed plots. See Figure @ref(fig:pie) for example:
par(mar = c(0, 1, 0, 1))
pie(
c(280, 60, 20),
c('Sky', 'Sunny side of pyramid', 'Shady side of pyramid'),
col = c('#0292D8', '#F7EA39', '#C4B632'),
init.angle = -50, border = NA
)
library(ggplot2)
ggplot(Orange, aes(x = age,
y = circumference,
color = Tree)) +
geom_point() +
geom_line() +
guides(color = FALSE) +
theme_bw()