# NOT RUN {
### Get path to example source
examplePath <-
system.file("extdata", package="rock");
### Get a path to one example file
exampleFile <-
file.path(examplePath, "example-1.rock");
### Load example source
loadedExampleSource <- rock::load_source(exampleFile);
### Split a code into two codes, showing progress (the backticks are
### used to be able to specify a name that starts with an underscore)
recoded_source <-
rock::recode_addChildCodes(
loadedExampleSource,
codes="childCode1",
childCodes = list(
`_and_` = " and ",
`_book_` = "book",
`_else_` = TRUE
),
silent=FALSE
);
# }
Run the code above in your browser using DataLab