Skip to content

Instantly share code, notes, and snippets.

@bhive01
Created April 18, 2018 14:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhive01/b36ffb60f1e8f87b47ab92ee0ea44f63 to your computer and use it in GitHub Desktop.
Save bhive01/b36ffb60f1e8f87b47ab92ee0ea44f63 to your computer and use it in GitHub Desktop.
---
title: "Untitled"
author: "Brandon Hurr"
date: "4/18/2018"
output:
beamer_presentation:
latex_engine: xelatex
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, error = FALSE)
```
## R Markdown
This is an R Markdown presentation. 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>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document.
## Slide with Bullets
- Bullet 1
- Bullet 2
- Bullet 3
## Slide with R Output
```{r cars, echo = TRUE, results='asis'}
library(tidyverse)
plot_function <- function(var) {
subset_df <- subset(mtcars, cyl == var)
p <- ggplot() + geom_point(data = subset_df, aes(x = hp, y = mpg))
cat(paste0("## Cylinder ", var))
cat("\n\n")
print(p)
cat("\n\n")
}
cyl_options <- c(4,6,8)
map(cyl_options, plot_function)
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment