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

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

Value

A R object corresponding to basename on file_path argument.

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").

Examples

if (FALSE) { tmpCars <- tempfile(pattern = "mtcars_temp_RDS_", fileext = ".RDS") saveRDS(object = mtcars, file = tmpCars) read_RDS_to_global(tmpCars) }