knitr::opts_chunk$set(echo = FALSE) param <- sort(unique(palmerpenguins::penguins$species)) param_len <- length(param)
Using tabset get all the penguin names in "tabs". Each section should print ok but get the same info.
param_num <- 1 # Define new environment child_env <- new.env() child_env$species <- param[param_num] # knit the document and save the character output to an object res <- knitr::knit_child( "species-child.Rmd", envir = child_env, quiet = TRUE ) # Cat the object to make it render in your main document cat(res, sep = '\n')
param_num <- 2 # Define new environment child_env <- new.env() child_env$species <- param[param_num] # knit the document and save the character output to an object res <- knitr::knit_child( "species-child.Rmd", envir = child_env, quiet = TRUE ) # Cat the object to make it render in your main document cat(res, sep = '\n')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.