knitr::opts_chunk$set(echo = TRUE, message = FALSE, warning = FALSE)
Knit to github_document
button in the tool bar above to generate a regular .md
file and any associated
image files..Rmd
, .md
and the _files
folder to the lab Github repo. scale_color_manual(values = cbPalette)
and scale_fill_manual(values = cbPalette)
for all plots. cbPalette
is exported by the rasilabRtemplates
package.# string manipulation functions library(stringr) # standard analysis and plotting functions, includes dplyr, ggplot2 library(tidyverse) # loads lab default ggplot2 theme and provides color-blind friendly palette library(rasilabRtemplates)
data <- read_csv("https://github.com/tidyverse/readr/raw/master/inst/extdata/mtcars.csv") %>% print()
processed_data <- data %>% filter(am == 1) %>% select(mpg, qsec, carb) processed_data %>% knitr::kable()
processed_data %>% gather(statistic, value, -carb) %>% ggplot(aes(x = carb, y = value, color = statistic)) + facet_wrap(~ statistic, ncol = 2) + geom_jitter(width = 0) + scale_color_manual(values = cbPalette)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.