# Create temp directory
tmp <- tempdir()
# Save some data to temp directory
# for illustration purposes
saveRDS(trees, file.path(tmp, "trees.rds"))
saveRDS(rock, file.path(tmp, "rocks.rds"))
saveRDS(beaver1, file.path(tmp, "beaver1.rds"))
# Create data library
libname(dat, tmp)
# # library 'dat': 3 items
# - attributes: rds not loaded
# - path: C:\Users\User\AppData\Local\Temp\RtmpklJcfl
# - items:
# Name Extension Rows Cols Size LastModified
# 1 beaver1 rds 114 4 5.9 Kb 2020-12-06 15:21:30
# 2 rocks rds 48 4 3.6 Kb 2020-12-06 15:21:30
# 3 trees rds 31 3 2.9 Kb 2020-12-06 15:21:30
# Print dictionary for library
dictionary(dat)
# A tibble: 11 x 10
# Name Column Class Label Description Format Width Justify Rows NAs
#
# 1 beaver1 day numeric NA NA NA NA NA 114 0
# 2 beaver1 time numeric NA NA NA NA NA 114 0
# 3 beaver1 temp numeric NA NA NA NA NA 114 0
# 4 beaver1 activ numeric NA NA NA NA NA 114 0
# 5 rocks area integer NA NA NA NA NA 48 0
# 6 rocks peri numeric NA NA NA NA NA 48 0
# 7 rocks shape numeric NA NA NA NA NA 48 0
# 8 rocks perm numeric NA NA NA NA NA 48 0
# 9 trees Girth numeric NA NA NA NA NA 31 0
# 10 trees Height numeric NA NA NA NA NA 31 0
# 11 trees Volume numeric NA NA NA NA NA 31 0
# Load library into workspace
lib_load(dat)
# Print summaries for each data frame
# Note that once loaded into the workspace,
# data can be accessed using two-level syntax.
summary(dat.rocks)
summary(dat.trees)
summary(dat.beaver1)
#Unload from workspace
lib_unload(dat)
# Clean up
lib_delete(dat)
Run the code above in your browser using DataLab