Segment: Segment

SegmentR Documentation

Segment

Description

A Segment object is automatically constructed and attached to the Pipeline when a call to make_*() is made. It stores the relationships between targets, dependencies, and sources.

Public fields

targets

A character vector of paths to files

dependencies

A character vector of paths to files which the targets depend on

packages

A character vector of names of packages which targets depend on

force

A logical determining whether or not execution of the source or recipe will be forced (i.e. happen whether or not the targets are out-of-date)

envir

The environment in which to execute the instructions.

result

An object, whatever is returned by executing the instructions

executed

A logical, whether or not the instructions were executed

execution_time

A difftime, the time taken to execute the instructions

label

A short label for the segment

note

A description of what the segment does

Active bindings

edges

Get edges connecting the dependencies, instructions, and targets

nodes

Get nodes corresponding to dependencies, instructions, and targets

text_summary

A plain text summary of the Segment

Methods

Public methods


Method new()

Initialise a new Segment

Usage
Segment$new(
  id,
  targets,
  dependencies,
  packages,
  envir,
  force,
  executed,
  result,
  execution_time
)
Arguments
id

An integer that uniquely identifies the segment

targets

A character vector of paths to files

dependencies

A character vector of paths to files which the targets depend on

packages

A character vector of names of packages which targets depend on

envir

The environment in which to execute the instructions.

force

A logical determining whether or not execution of the source or recipe will be forced (i.e. happen whether or not the targets are out-of-date)

executed

A logical, whether or not the instructions were executed

result

An object, whatever is returned by executing the instructions

execution_time

A difftime, the time taken to execute the instructions


Method print()

Printing method

Usage
Segment$print()

Method update_result()

Update the Segment with new execution information

Usage
Segment$update_result(executed, execution_time, result)
Arguments
executed

A logical, whether or not the instructions were executed

execution_time

A difftime, the time taken to execute the instructions

result

An object, whatever is returned by executing the instructions


Method annotate()

Apply annotations to Segment

Usage
Segment$annotate(label = NULL, note = NULL)
Arguments
label

A short label for the segment

note

A description of what the segment does


Method clone()

The objects of this class are cloneable with this method.

Usage
Segment$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

Other segment: SegmentRecipe, SegmentSource


makepipe documentation built on Dec. 7, 2022, 5:16 p.m.