qwraps2 (version 0.4.2)

lazyload_cache_dir: Lazyload Cache

Description

Lazyload Cached label(s) or a whole directory.

Usage

lazyload_cache_dir(
  path = "./cache",
  envir = parent.frame(),
  ask = FALSE,
  verbose = TRUE,
  full.names = TRUE,
  ...
)

lazyload_cache_labels( labels, path = "./cache/", envir = parent.frame(), verbose = TRUE, filter, full.names = TRUE, ... )

Arguments

path

the path to the cache directory.

envir

the environment to load the objects into

ask

if TRUE ask the user to confirm loading each database found in path

verbose

if TRUE display the chunk labels being loaded

full.names

use the full name, i.e., include the path, for the chunk label? This argument is passed to list.files.

...

additional arguments passed to list.files.

labels

a character vector of the chunk labels to load.

filter

an optional function passed to lazyLoad. when called on a character vector of object names returns a logical vector: only objects for which this is true will be loaded.

Details

These functions helpful for loading cached chunks into an interactive R session. Consider the following scenario: you use knitr and have cached chunks for lazyloading. You've created the document, close up your IDE and move on to the next project. Later, you revisit the initial project and need to retrieve the objects created in the cached chunks. One option is to reevaluate all the code, but this could be time consuming. The other option is to use lazyload_cache_labels or lazyload_cache_dir to quickly (lazy)load the chunks into an active R session.

Use lazyload_cache_dir to load a whole directory of cached objects.

Use lazyload_cache_labels to load and explicit set of cached chunks.