#' # Create temp directory
tmp <- tempdir()
# Create library
libname(dat, tmp)
# Add data to the library
lib_add(dat, mtcars)
# library 'dat': 3 items
# - attributes: not loaded
# - path: C:\Users\User\AppData\Local\Temp\RtmpCSJ6Gc
# - items:
# Name Extension Rows Cols Size LastModified
# 1 mtcars rds 32 11 7.5 Kb 2020-11-05 19:32:00
# Replace data with a subset
lib_replace(dat, mtcars[1:10, 1:5], name = "mtcars")
# library 'dat': 3 items
# - attributes: not loaded
# - path: C:\Users\User\AppData\Local\Temp\RtmpCSJ6Gc
# - items:
# Name Extension Rows Cols Size LastModified
# 1 mtcars rds 10 5 7.5 Kb 2020-11-05 19:33:00
# Clean up
lib_delete(dat)
Run the code above in your browser using DataLab