This is a very simple example of using purrr and RMarkdown to produce several plots all at once.
Purrr example
Chris Beeley
16 August 2018
invisible( # suppress console output from hist()
map(c(5, 6, 7), function(x) { # values to feed to filter function
iris %>%
filter(Sepal.Length < x) %>% # just Sepal.Length < 5, 6, and 7
pull(Petal.Width) %>% # extract Petal.Width vector
hist(breaks = 20, main = paste0("Histogram of < ", x)) # graph
})
)
// add bootstrap table styles to pandoc tables function bootstrapStylePandocTables() { $('tr.header').parent('thead').parent('table').addClass('table table-condensed'); } $(document).ready(function () { bootstrapStylePandocTables(); });