View source: R/syntaxtractor.R
syntaxtractor | R Documentation |
parses asdfree textbook for runnable code. probably not useful for anything else.
syntaxtractor(data_name, repo = "ajdamico/asdfree", ref = "master",
replacements = NULL, setup_rmd = TRUE, test_rmd = TRUE,
sample_setup_breaks = NULL, broken_sample_test_condition = NULL)
data_name |
a character vector with a microdata abbreviation |
repo |
github repository containing textbook |
ref |
github branch containing textbook |
replacements |
list containing text to swap out and in, using regular expressions |
setup_test |
either "setup" for dataname-setup.R or "test" for dataname-test.R or NULL for everything |
filepath with runnable code
## Not run:
replacements_list <- list( c( "C:/My Directory" , tempdir() ) )
runnable_code <- syntaxtractor( "yrbss" , replacements = replacements_list )
source( runnable_code , echo = TRUE )
# usage examples
source( syntaxtractor( "prerequisites" ) , echo = TRUE )
source( syntaxtractor( "ahrf" , replacements = NULL ) , echo = TRUE )
source( syntaxtractor( "nppes" , replacements = NULL ) , echo = TRUE )
source( syntaxtractor( "pisa" , replacements = NULL ) , echo = TRUE )
source( syntaxtractor( "pnad" , replacements = NULL ) , echo = TRUE )
source( syntaxtractor( "scf" , replacements = NULL ) , echo = TRUE )
source( syntaxtractor( "yrbss" , replacements = NULL ) , echo = TRUE )
some_info <- list( "email@address\\.com" , "ajdamico@gmail.com" )
source( syntaxtractor( "lavaan" , replacements = some_info ) , echo = TRUE )
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.