load2env: Tidy load from file to list

Description Usage Arguments Examples

View source: R/load_files.R

Description

To avoid use commands of the form load(file), this function loads the file into an environment and then return the environment.

Usage

1
load2env(file, env = new.env())

Arguments

file

string with the name of an RData file

env

an environment, to which the file is going to be load into. By default the function creates a new one.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 

data(iris)
my_file = tempfile(fileext = ".RData")
save(iris, file = my_file)
load2env(my_file)


## End(Not run)

welch16/rwlib documentation built on Jan. 13, 2020, 1:27 p.m.