# Create temp directory
tmp <- tempdir()
# Create library
libname(dat, tmp)
# # library 'dat': 0 items
# - attributes: rds not loaded
# - path: C:\Users\User\AppData\Local\Temp\RtmpCSJ6Gc
# NULL
# Load the empty library
lib_load(dat)
# Add data to the library
dat.mtcars <- mtcars
dat.beaver1 <- beaver1
dat.iris <- iris
# Unload the library
lib_unload(dat)
# library 'dat': 3 items
# - attributes: rds not loaded
# - path: C:\Users\User\AppData\Local\Temp\RtmpCSJ6Gc
# - items:
# Name Extension Rows Cols Size LastModified
# 1 beaver1 NA 114 4 4.6 Kb
# 2 iris NA 150 5 7.1 Kb
# 3 mtcars NA 32 11 7 Kb
# Write the library to the file system
lib_write(dat)
# library 'dat': 3 items
#- attributes: not loaded
#- path: C:\Users\User\AppData\Local\Temp\RtmpCSJ6Gc
#- items:
# Name Extension Rows Cols Size LastModified
#1 beaver1 rds 114 4 4.8 Kb 2020-11-05 20:47:16
#2 iris rds 150 5 7.3 Kb 2020-11-05 20:47:16
#3 mtcars rds 32 11 7.3 Kb 2020-11-05 20:47:16
# Clean up
lib_delete(dat)
Run the code above in your browser using DataLab