Description Usage Arguments Value Note Author(s) See Also Examples
Load all named objects into the specified environment.
1 2 |
objNames |
A character vector of object names to load lazily, usually from a lazyLs call.
If |
md5Hashes |
Object hash. |
lazyDir |
Character string of directory to be used for the lazy databases. |
envir |
Environment into which the objects are loaded. Default is |
verbose |
Logical. If notes about rasters whose file backings were corrected on the fly from previous, i.e,. wrong, filenames. |
Invisibly, the objects read in returned. This function is used for its side effects, i.e., loading lazy objects.
Rasters have a special behaviour. If the filename associated with a raster is
pointing to a file that doesn't exist, then it will try the prepend the lazyDir
to the
filename inside the Raster*
object. The raster filenames can become incorrect if
the absolute path to the file changes due to a changing of operating system or moving
from a removable drive. For example, a removable drive, which was mapped to, say E: in the
computer where the object was originally lazySave
d, gets replugged in but mapped to
F:, then the absolute paths will be wrong. This will be automatically corrected, with a warning,
if the filename can be found by looking in the relative path /rasters/
below
lazyDir
.
Eliot McIntire
1 2 3 4 5 6 7 8 9 10 11 12 | library(SpaDES)
tmpdir <- checkPath(file.path(tempdir(), "lazyDir"), create=TRUE)
obj <- rnorm(10)
# save the obj
lazySave(obj, lazyDir=tmpdir)
# remove the obj
rm(obj)
any(ls()=="obj") # Is FALSE
# load it back in
lazyLoad2("obj", lazyDir=tmpdir)
any(ls()=="obj") # Is TRUE
unlink(tmpdir, recursive = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.