extractRcode | R Documentation |
extractRcode pulls out the r-code blocks from Rmd or qmd files
and saves them into a separate R file. This depends upon the prefix used to define R blocks at the top and bottom. So it 'knows' where they begin and where they end. Any R-code included that is not encased in the
prefix will not be extracted.
extractRcode(indir, rmdfile, filename = "out.R")
indir |
the directory in which the rmd file is to be found and into which the output file will be placed. |
rmdfile |
name of Rmd/qmd file whose R code is to be extracted |
filename |
the name of the R file into which the r-code is to go. |
generates an R file in the indir but returns nothing
ddir <- getDBdir()
# syntax extractRcode(pathtopath(ddir,"projects/AIRF/NWLML"),
# "Drivers_of_Productivity.qmd",
# filename="productivity.R")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.