lib_unload function unloads a data library from
the workspace environment. The unload function does not delete the data
or remove the library. It simply removes the data frames from working
memory. By default, the
lib_unload function will also synchronize the
data in working memory with the data stored in the library list, as these
two instances can become out of sync if you change the data in working memory.
lib_unload(x, sync = TRUE, name = NULL)
The data library to unload.
Whether to sync the workspace with the library list before it is unloaded. Default is TRUE. If you want to unload the workspace without saving the workspace data, set this parameter to FALSE.
The name of the library to unload, if the name is different than the variable name. Used internally.
The unloaded data library.
lib_load to load the library.
# Create temp directory tmp <- tempdir() # Create library libname(dat, tmp) # Add data to library lib_add(dat, iris, ToothGrowth, PlantGrowth) # 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)