# Create temp directory
tmp <- tempdir()
# Create library
libname(dat1, tmp)
# Add dat to library
lib_add(dat1, mtcars, iris)
# Export dat1 to dat2
lib_export(dat1, dat2, file.path(tmp, "export"), "rdata")
# library 'dat2': 2 items
# - attributes: rdata not loaded
# - path: C:\Users\User\AppData\Local\Temp\Rtmp0Sq3kt/export
# - items:
# Name Extension Rows Cols Size LastModified
# 1 mtcars rdata 32 11 8.1 Kb 2022-06-23 00:10:52
# 2 iris rdata 150 5 8.1 Kb 2022-06-23 00:10:52
# Clean up
lib_delete(dat1)
lib_delete(dat2)
Run the code above in your browser using DataLab