lib_load function loads a data library into
an environment. The environment used is associated with the library at
the time it is created with the
lib_load function is called, the data frames/tibbles
will be loaded with <library>.<data set> syntax. Loading the data frames
into the environment makes them easy to access and use in your program.
lib_load(x, filter = NULL)
The data library to load.
One or more quoted strings to use as filters for the data names to load into the workspace. For more than one filter string, pass them as a vector of strings. The filter string can be a full or partial name. If using a partial name, use a wild-card character (*) to identify the missing portion. The match will be case-insensitive.
The loaded data library.
lib_unload to unload the library.
# Create temp directory tmp <- tempdir() # Save some data to temp directory for illustration purposes saveRDS(iris, file.path(tmp, "iris.rds")) saveRDS(ToothGrowth, file.path(tmp, "ToothGrowth.rds")) saveRDS(PlantGrowth, file.path(tmp, "PlantGrowth.rds")) # Create library libname(dat, tmp) # Load library into workspace lib_load(dat) # Examine workspace ls() #  "dat" "dat.iris" "dat.PlantGrowth" "dat.ToothGrowth" "tmp" # Use some data summary(dat.PlantGrowth) summary(dat.ToothGrowth) # Unload library lib_unload(dat) # Examine workspace again ls() #  "dat" "tmp" # Clean up lib_delete(dat)