Cycles through all of the spec files inside a folder. The default behaivor is if a language setting is detected ('Sys.getenv("LANGUAGE")'), it will look for a sub-folder that matches the setting inside the 'spec_folder' path.
The function translates and loads each new data set to a specified R environment.
This function is meant for packages that will do not wish to ship a copy of the data set, and wish to execute the translation on the fly, preferably when the "host" package is attached.
1 2 3 | on_attach(package = NULL, spec_folder = system.file("translations",
package = package), envir = as.environment(paste0("package:",
package)), language = NULL, verbose = TRUE)
|
package |
Name of the package as a character variable. It is used in the help tracker. |
spec_folder |
The path to the folder where the YAML spec files are located. Defaults to 'inst/specs'. |
envir |
The target environment where the translated data set will be loaded to. Defaults to the base R environment. |
language |
Optional argument that allows the target language to be specified. |
verbose |
Prints to the console the name of the original data set, and the name of the new translated data set. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.