drake (version 6.2.1)

default_short_hash_algo: Return the default short hash algorithm for make().

Description

See the advanced storage tutorial at https://ropenscilabs.github.io/drake-manual/store.html for details.

Usage

default_short_hash_algo(cache = NULL)

Arguments

cache

optional drake cache. When you configure_cache() without supplying a short hash algorithm, default_short_hash_algo(cache) is the short hash algorithm that drake picks for you.

Value

A character vector naming a hash algorithm.

Details

The short algorithm must be among available_hash_algos(), which is just the collection of algorithms available to the algo argument in digest::digest().

If you express no preference for a hash, drake will use the short hash for the existing project, or default_short_hash_algo() for a new project. If you do supply a hash algorithm, it will only apply to fresh projects (see clean(destroy = TRUE)). For a project that already exists, if you supply a hash algorithm, drake will warn you and then ignore your choice, opting instead for the hash algorithm already chosen for the project in a previous make().

drake uses both a short hash algorithm and a long hash algorithm. The shorter hash has fewer characters, and it is used to generate the names of internal cache files and auxiliary files. The decision for short names is important because Windows places restrictions on the length of file paths. On the other hand, some internal hashes in drake are never used as file names, and those hashes can use a longer hash to avoid collisions.

See Also

make(), available_hash_algos()

Examples

Run this code
# NOT RUN {
default_short_hash_algo()
# }
# NOT RUN {
test_with_dir("Quarantine side effects.", {
load_mtcars_example() # Get the code with drake_example("mtcars").
# Run the project and return the internal master configuration list.
config <- make(my_plan)
# Locate the storr cache.
cache <- config$cache
# Get the default short hash algorithm of an existing cache.
default_short_hash_algo(cache)
})
# }

Run the code above in your browser using DataCamp Workspace