Learn R Programming

BBmisc (version 1.10)

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, impute)

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.
impute
[ANY] If file does not exists, return impute instead. Default is missing which will result in an exception if file is not found.

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