Learn R Programming

drake (version 5.2.1)

new_cache: Make a new drake cache.

Description

Uses the storr_rds() function from the storr package.

Usage

new_cache(path = drake::default_cache_path(),
  verbose = drake::default_verbose(), type = NULL,
  short_hash_algo = drake::default_short_hash_algo(),
  long_hash_algo = drake::default_long_hash_algo(), ...,
  console_log_file = NULL)

Arguments

path

file path to the cache if the cache is a file system cache.

verbose

logical or numeric, control printing to the console. Use pkgconfig to set the default value of verbose for your R session: for example, pkgconfig::set_config("drake::verbose" = 2).

0 or FALSE:

print nothing.

1 or TRUE:

print only targets to build.

2:

in addition, print checks and cache info.

3:

in addition, print any potentially missing items.

4:

in addition, print imports. Full verbosity.

type

deprecated argument. Once stood for cache type. Use storr to customize your caches instead.

short_hash_algo

short hash algorithm for the cache. See default_short_hash_algo() and make()

long_hash_algo

long hash algorithm for the cache. See default_long_hash_algo() and make()

...

other arguments to the cache constructor

console_log_file

character scalar or NULL. If NULL, console output will be printed to the R console using message(). Otherwise, console_log_file should be the name of a flat file. Console output will be appended to that file.

Value

A newly created drake cache as a storr object.

See Also

default_short_hash_algo(), default_long_hash_algo(), make()

Examples

Run this code
# NOT RUN {
test_with_dir("Quarantine new_cache() side effects.", {
clean(destroy = TRUE) # Should not be necessary.
unlink("not_hidden", recursive = TRUE) # Should not be necessary.
cache1 <- new_cache() # Creates a new hidden '.drake' folder.
cache2 <- new_cache(path = "not_hidden", short_hash_algo = "md5")
clean(destroy = TRUE, cache = cache2)
})
# }

Run the code above in your browser using DataLab