prSave {tinyProject} | R Documentation |
Easily save and load data
Description
prSave
and prLoad
save and load data in the folder data
of the project. Each object is saved in distinct file with the same name as
the object and the extension rda
.
Usage
prSave(name, replace = FALSE, desc = "No description", subdir = ".")
prLoad(name, subdir = ".", trace = TRUE, envir = .GlobalEnv)
Arguments
name |
Name of the object to save or to load. Quotes are optional. Optionaly, one can also specify the subfolder where to save or load the object. |
replace |
If the file already exists, should it be overwrited ? The prupose of this parameter is to avoid some dramas. Use it with caution. |
desc |
Short description of the object. |
subdir |
subdirectory where to save or load the object. |
trace |
Should information about the loaded object be printed ? |
envir |
the environment where the object should be loaded. By default, it is the global environement so that the object should be easily accessible in all settings |
See Also
Examples
projectPath <- file.path(tempdir(), "test")
prInit(projectPath)
test <- rnorm(100)
prSave(test)
list.files(projectPath, recursive = TRUE, include.dirs = TRUE)
# Save again but add a description
prSave(test, replace = TRUE, desc = "Just a test !")
prLoad(test)
# It is also possible to save/load in subfolders
prSave(test, TRUE, subdir = "testdir", desc = "Saved in subfolder")
list.files(projectPath, recursive = TRUE, include.dirs = TRUE)
# Or equivalently
prSave("testdir/test", TRUE, desc = "Saved in subfolder")
prLoad(test, subdir="testdir")
prLoad("testdir/test")
[Package tinyProject version 0.6.1 Index]