read_RDS_to_global: Read RDS file Directly to Global Environment

Description Usage Arguments Details Value Examples

View source: R/read-RDS-to-global.R

Description

The function provides convenience mechanism for creating R objects corresponding to names of RDS files.

Usage

1
read_RDS_to_global(file_path, verbose = TRUE, pos = 1)

Arguments

file_path

Path to the RDS file.

verbose

A logical, if TRUE prints a short message with name of created object.

pos

defaults to 1 which equals an assignment to global environment

Details

For instance, when executing saved_data <- readRDS("file_path_to/saved_data.RDS") we may do read_RDS_to_global("file_path_to/saved_data.RDS").

Value

A R object corresponding to basename on file_path argument.

Examples

1
2
3
4
5
6
## Not run: 
  tmpCars <- tempfile(pattern = "mtcars_temp_RDS_", fileext = ".RDS")
  saveRDS(object = mtcars, file = tmpCars)
  read_RDS_to_global(tmpCars)

## End(Not run)

konradedgar/KEmisc documentation built on April 15, 2021, 1:50 p.m.