diff --git a/R/rmd_helpers.R b/R/rmd_helpers.R index acb5ce1..96d646e 100644 --- a/R/rmd_helpers.R +++ b/R/rmd_helpers.R @@ -8,6 +8,7 @@ #' @return a string where each element in `x` is separated by a comma #' @export #' @author Kelly Sovacool \email{sovacool@@umich.edu} +#' @author Pat Schloss \email{pschloss@@umich.edu} #' #' @examples #' paste_oxford_list(1:3) @@ -52,3 +53,23 @@ inline_hook <- function(x){ paste(x) } } + + +#' Set knitr chunk options & inline hook +#' +#' Call this function in the setup chunk of your R Markdown files. +#' +#' @export +#' @author Pat Schloss \email{pschloss@@umich.edu} +#' @author Kelly Sovacool \email{sovacool@@umich.edu} +#' +set_knitr_opts <- function() { + knitr::opts_chunk$set( + tidy = TRUE, + echo = FALSE, + eval = TRUE, + warning = FALSE, + cache = FALSE + ) + knitr::knit_hooks$set(inline=inline_hook) +}