Utility to load a couple of datasets using data immediately instead of relying on lazy loading
Source:R/dataload_from_package.R
dataload_from_package.Rd
Utility to load a couple of datasets using data immediately instead of relying on lazy loading
Details
See also read_builtin() function from the readr package!
Default is to load some but not all the datasets into memory immediately. blockgroupstats, usastats, statestats, and some others are always essential to EJAM, but frs and frs_by_programid are huge datasets (and frs_by_sic and frs_by_naics) and not always used - only to find regulated facilities by ID, etc. The frs-related datasets here can be roughly 1.5 GB in RAM, perhaps.
Examples
x <- datapack("EJAM")
#> Error in datapack("EJAM"): could not find function "datapack"
subset(x, x$size >= 0.1) # at least 100 KB
#> Error: object 'x' not found
grep("names_", x$Item, value = T, ignore.case = T, invert = T) # most were like names_d, etc.
#> Error: object 'x' not found
ls()
#> character(0)
data("avg.in.us", package="EJAM") # lazy load an object into memory and make it visible to user
ls()
#> character(0)
rm(avg.in.us, x)
#> Warning: object 'avg.in.us' not found
#> Warning: object 'x' not found