squeeze_rmds | R Documentation |
This function extracts R code from .Rmd
files belonging to bookdown projects.
By default, it scans the working directory for numbered .Rmd
files and passes them to knitr::purl()
which tangles the code chunks whithin to .R
files.
It is intended as a convenience function for students working with Introduction to Econometrics with R,
an interactive online-companion to the textbook Introduction to Econometrics (Stock & Watson 2015). The companion can be found here. The function works with arbitrary .Rmd
files and is useful for working with other bookdown projects, too.
squeeze_rmds(dir = ".", numbered = T, out = "Rcodes", prefix = "", ...)
dir |
Path of the directory containing the |
numbered |
|
out |
Path to the output directory where the tangled codes will be saved. Points the |
prefix |
|
... |
Further arguments passed to |
## Not run:
# tangle numbered chapters of a bookdown project at working directory
squeeze_rmds(numbered = TRUE, prefix = "Chapter_")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.