writeWorkspace: Writes R script workspace to file in script's Results...

Description Usage Arguments Details Value Examples

View source: R/workspaceOperations.R

Description

Writes R script workspace to file in script's Results directory

Usage

1
2
3
4
5
6
7
writeWorkspace(
  objectList = ls(envir = parent.frame()),
  fileOut = NA,
  description = "",
  limit = 2,
  preserve = FALSE
)

Arguments

objectList

optional character vector of R object names to write to file

fileOut

optional fileName to write workspace to

description

character string describing workspace

limit

positive integer indicating how many R script workspaces are preserved within this project

preserve

logical indicating whether the workspace file is protected form deletion regarding the limit parameter.

Details

Writes workspace to file, by default it writes all R objects except source_info object. The function is useful for interrogating freshly written R scripts without having to rerun. Also, can be used to pass multiple objects from one R script to the next. The limit parameter limits the file memory space that these workspace dumps can leave behind by deleting older workspace dumps. The preserve logical protects the workspace dump from deletion. The preserve argument should be TRUE if other R scripts depend on the workspace! Workspace file ends end the file suffix ".ws"

Value

return form base::save from workspace write to file.

Examples

1
2
3
4
5
6
7
8
## Not run: 
# Within R script: don't preserve, but save last 4 workspaces
writeWorkspace(limit=4)
# Within R script: preserve, workspace is used by another R script
writeWorkspace(objectList=c("my","favorite","Robjects"),
fileOut="usefulRObjects",description="load me",preserve=TRUE)

## End(Not run) 

gelfondjal/adapr documentation built on Feb. 2, 2020, 1:32 a.m.