Last chance! 50% off unlimited learning
Sale ends in
Attach(lib = Sys.getenv("R_LOCAL_CACHE", unset = ".R_Cache"),
lib.loc = Sys.getenv("R_LOCAL_LIB_LOC", unset = "."),
pos = 2, uniquely = TRUE, readonly = FALSE, ...)
AttachData(...)
AttachUtils(...)
Attach
, the value of theR
Attach
, the value of theR
environment
variableR_LOCAL_LIB_LOC
, or the current working directory
if unseTRUE
, a single copy only is left on the
search path.TRUE
modifications to the objects in the cache
are prevented.SOAR
functions.
Presently unused.file.path(lib.loc, lib)
, currently does
not exist a warning is issued to that effect, but also advising that
the directory will be created when an object is to be Store
d
there.attach
, detach
.## change default cache, keeping any previous setting
oldLC <- Sys.getenv("R_LOCAL_CACHE", unset = ".R_Cache")
Sys.setenv(R_LOCAL_CACHE=".R_Test")
## generate some dummy data
dummy <- rnorm(100)
mn <- mean(dummy)
va <- var(dummy)
Attach() # may give warning
## store it in the stored object cache
Store(dummy, mn, va)
Search()
Attach(pos=3) # change to pos=3
Search()
Objects()
Remove(mn, va)
Objects()
Remove(Objects()) # empty the cache
detach(".R_Test") # remove from search path
Sys.setenv(R_LOCAL_CACHE=oldLC) # restore normal default
Run the code above in your browser using DataLab