Learn R Programming

BBmisc (version 1.2-200)

load2: Load RData file and return objects in it.

Description

Load RData file and return objects in it.

Usage

load2(file, parts, simplify = TRUE, envir)

Arguments

file
[character(1)] File to load.
parts
[character] Elements in file to load. Default is all.
simplify
[logical(1)] If TRUE, a list is only returned if parts and the file contain both more than 1 element, otherwise the element is directly returned. Default is TRUE.
envir
[environment(1)] Assign objects to this environment. Default is not to assign.

Value

  • Either a single object or a list.

Examples

Run this code
fn <- tempfile()
save2(file=fn, a=1, b=2, c=3)
load2(fn, parts="a")
load2(fn, parts=c("a", "c"))

Run the code above in your browser using DataLab