Loading tools/chunk-options.R +9 −3 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ opts_chunk$set(tidy = FALSE, results = "markup", comment = NA, fig.align = "center", fig.path = "fig/") # The hooks below add html tags to the code chunks and their output so that they # are properly formatted when the site is built with jekyll. # are properly formatted when the site is built. hook_in <- function(x, options) { stringr::str_c("\n\n~~~{.r}\n", paste0(x, collapse="\n"), Loading @@ -22,5 +22,11 @@ hook_out <- function(x, options) { "\n~~~\n\n") } knit_hooks$set(source = hook_in, output = hook_out, warning = hook_out, error = hook_out, message = hook_out) hook_error <- function(x, options) { stringr::str_c("\n\n~~~{.error}\n", paste0(x, collapse="\n"), "\n~~~\n\n") } knit_hooks$set(source = hook_in, output = hook_out, warning = hook_error, error = hook_error, message = hook_out) Loading
tools/chunk-options.R +9 −3 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ opts_chunk$set(tidy = FALSE, results = "markup", comment = NA, fig.align = "center", fig.path = "fig/") # The hooks below add html tags to the code chunks and their output so that they # are properly formatted when the site is built with jekyll. # are properly formatted when the site is built. hook_in <- function(x, options) { stringr::str_c("\n\n~~~{.r}\n", paste0(x, collapse="\n"), Loading @@ -22,5 +22,11 @@ hook_out <- function(x, options) { "\n~~~\n\n") } knit_hooks$set(source = hook_in, output = hook_out, warning = hook_out, error = hook_out, message = hook_out) hook_error <- function(x, options) { stringr::str_c("\n\n~~~{.error}\n", paste0(x, collapse="\n"), "\n~~~\n\n") } knit_hooks$set(source = hook_in, output = hook_out, warning = hook_error, error = hook_error, message = hook_out)