use_cache: use_cache

Description Usage Arguments Details See Also

View source: R/use_cache.R

Description

Add a cache to a project

Usage

1
2
3
4
5
6
7
use_cache(
  path = cache_find(),
  ignore = TRUE,
  ...,
  git_ignore = ignore,
  rbuild_ignore = ignore
)

Arguments

path

string; path to cache directory (DEFAULT:NULL)

ignore

logical; whether to ignore both .gitignore and rbuildignore

...

unused – requires that git_ignore and rbuild_ignore be explicitly named

git_ignore

logical; whether to put cache in .gitignore (DEFAULT: TRUE)

rbuild_ignore

logical; whether to put cache is .Rbuildignore (DEFAULT: TRUE)

Details

In most cases, all you need to do is use_cache(). This will:

Arguments allow for fine tuning of the behaviors.

path allows for the cache directory to be specified. If the directory does not exist, it is created. The default is to use cache_find() to search for a pre-existing cache. See cache_find() for details.

git_ignore controls whether the cache is ignored by git. The default is not to commit the cache data to git as the cache is seen as a working directory.

rbuild_ignore controls whether the cache is incorporated into the package build. The default is not to include them.

Both git_ignore and rbuild_ignore require explicit argument names.

See Also


decisionpatterns/cache documentation built on June 15, 2020, 9:35 p.m.