release_target: Save a target to a pinboard.

View source: R/storing.R

release_targetR Documentation

Save a target to a pinboard.

Description

Releases (release = TRUE) or not (release = FALSE) a new version of the target target using the pins package.

Usage

release_target(
  pipeline_releases_folder,
  targ,
  targ_name,
  type = "rds",
  release = FALSE
)

Arguments

pipeline_releases_folder

The folder that contains the pinboard for releases from the pipeline.

targ

The target R object to be saved to the pinboard.

targ_name

The name of the target object. targ_name is the key to retrieving targ.

type

The type of the target, routed to pins::pin_write(). Default is "rds".

release

A boolean telling whether to do a release. Default is FALSE.

Details

Released versions of the target can be obtained as shown in examples.

Value

If release is TRUE, the fully-qualified path name of the targ file in the pinboard. If release is FALSE, the string "Release not requested."

Examples

## Not run: 
# Establish the pinboard
pinboard <- pins::board_folder("~/Dropbox/Fellowship 1960-2015 PFU database/PipelineReleases/")
# Get information about the `PSUT` target in the pinboard
pinboard %>%
  pins::pin_meta(name = "psut")
# Find versions of the `PSUT` target
pinboard %>%
  pins::pin_versions(name = "psut")
# Get the latest copy of the `PSUT` target.
my_psut <- pinboard %>%
  pins::pin_read(name = "psut")
# Retrieve a previous version of the `PSUT` target.
my_old_psut <- pinboard %>%
  pins::pin_read(name = "psut", version = "20220218T023112Z-1d9e1")
## End(Not run)

MatthewHeun/SEAPSUTWorkflow documentation built on April 22, 2022, 2:21 p.m.