Target-accessors: 'Target' class get and set methods

nameR Documentation

Target class get and set methods

Description

Get and set methods for the Target S4 class.

Usage

name(x)

## S4 method for signature 'Target'
name(x)

name(x) <- value

## S4 replacement method for signature 'Target'
name(x) <- value

command(x)

## S4 method for signature 'Target'
command(x)

command(x) <- value

## S4 replacement method for signature 'Target'
command(x) <- value

type(x)

## S4 method for signature 'Target'
type(x)

type(x) <- value

## S4 replacement method for signature 'Target'
type(x) <- value

args(x)

## S4 method for signature 'Target'
args(x)

args(x) <- value

## S4 replacement method for signature 'Target'
args(x) <- value

comment(x)

## S4 method for signature 'Target'
comment(x)

comment(x) <- value

## S4 replacement method for signature 'Target'
comment(x) <- value

code(x)

## S4 method for signature 'Target'
code(x)

Arguments

x

S4 object of class Target

value

value to set

Examples

workflow_target <- target('a_target',
                          1 + 1,
                          args = list(memory = 'persistent'), 
                          comment = 'A target')

## Return the target name
name(workflow_target)

## Set the target name
name(workflow_target) <- 'a_new_name'

## Return the target R code
command(workflow_target)

## Set the target R code
command(workflow_target) <- rlang::expr(1 * 2)

## Return the target type
type(workflow_target)

## Set the target type
type(workflow_target) <- 'tarchetypes::tar_file'

## Return the list target arguments
args(workflow_target)

## Set the target arguments
args(workflow_target) <- list(error = 'continue')

## Return the target comment
comment(workflow_target)

## Set the workflow comment
comment(workflow_target) <- 'A new comment'

jasenfinch/metaboWorkflows documentation built on May 24, 2023, 8:23 a.m.