tar_seed: Deprecated: get the seed of the current target.

View source: R/tar_seed.R

tar_seedR Documentation

Deprecated: get the seed of the current target.

Description

Deprecated on 2023-10-12 (version 1.3.2.9001). Use tar_seed_get() instead.

Usage

tar_seed(default = 1L)

Arguments

default

Integer, value to return if tar_seed_get() is called on its own outside a targets pipeline. Having a default lets users run things without tar_make(), which helps peel back layers of code and troubleshoot bugs.

Value

Integer of length 1. If invoked inside a targets pipeline, the return value is the seed of the target currently running, which is a deterministic function of the target name. Otherwise, the return value is default.

Examples

tar_seed()
tar_seed(default = 123L)
if (identical(Sys.getenv("TAR_EXAMPLES"), "true")) { # for CRAN
tar_dir({ # tar_dir() runs code from a temp dir for CRAN.
tar_script(tar_target(returns_seed, tar_seed()), ask = FALSE)
tar_make()
tar_read(returns_seed)
})
}

wlandau/targets documentation built on May 1, 2024, 7:27 p.m.