Learn R Programming

Kmisc (version 0.5.0)

kLoad: Load and Assign an R Object

Description

The regular load function keeps the old variable name used when saving that object. Often, we would prefer to assign the loaded object to a new variable name. Hence, this function.

Usage

kLoad(...)
getload(...)

Arguments

...
args to pass to load

Value

the object stored in the load-ed object

Details

If multiple arguments are supplied, they will be concatenated through file.path.

See Also

load

Examples

Run this code
dat <- data.frame( x = c(1,2,3), y=c('a','b','c') )
save( dat, file="dat.rda" )
rm( dat )
my_data <- kLoad( "dat.rda" )
## we protect ourselves from 'forgetting' the name of the
## object we saved

Run the code above in your browser using DataLab