Learn R Programming

targets (version 0.0.0.9000)

tar_read_raw: Read a target's value from storage (raw version)

Description

Like tar_read() except name is a character string. Do not use in knitr or R Markdown reports with tarchetypes::tar_knit() or tarchetypes::tar_render().

Usage

tar_read_raw(name, branches = NULL, meta = tar_meta())

Arguments

name

Character, name of the target to read.

branches

Integer of indices of the branches to load if the target is a pattern.

meta

Data frame of metadata from tar_meta(). tar_read() with the default arguments can be inefficient for large pipelines because all the metadata is stored in a single file. However, if you call tar_meta() beforehand and supply it to the meta argument, then successive calls to tar_read() may run much faster.

Value

The target's return value from its file in _targets/objects/, or the paths to the custom files and directories if format = "file" was set.

Examples

Run this code
# NOT RUN {
tar_dir({
tar_script(tar_pipeline(tar_target(x, 1 + 1)))
tar_make()
tar_read_raw("x")
})
# }

Run the code above in your browser using DataLab