prSave: Easily save and load data

Description Usage Arguments See Also Examples

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

1
2
3
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

prLibrary, prSource

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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")
  

cuche27/project documentation built on May 14, 2019, 12:50 p.m.