View source: R/save_workspace.R
save_workspace | R Documentation |
When conducting analyses, you make many choices that ideally, you document and justify. This function saves stored justifications to a file.
save_workspace( file = rock::opts$get("justificationFile"), encoding = rock::opts$get("encoding"), append = FALSE, preventOverwriting = rock::opts$get("preventOverwriting"), silent = rock::opts$get("silent") )
file |
If specified, the file to export the justification to. |
encoding |
The encoding to use when writing the file. |
append |
Whether to append to the file, or replace its contents. |
preventOverwriting |
Whether to prevent overwriting an existing file. |
silent |
Whether to be silent or chatty. |
The result of a call to justifier::export_justification()
.
### 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 loadedExample <- 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_split( loadedExample, codes="childCode1", splitToCodes = list( `_and_` = " and ", `_book_` = "book", `_else_` = TRUE ), silent=FALSE, justification = "Because this seems like a good idea" ); ### Save this workspace to a file temporaryFilename <- tempfile(); rock::save_workspace(file = temporaryFilename);
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.