MetadataActionMutate: Metadata action: mutate

MetadataActionMutateR Documentation

Metadata action: mutate

Description

Metadata action: mutate

Metadata action: mutate

Details

Generate a new field from an old field and optional helper fields. This uses glue expressions. TODO: By default, only a limited set of functions should be available, since this otherwise allows arbitrary code execution from a metadata transformation schema. See https://stackoverflow.com/questions/66174947/r-glue-with-limited-set-of-functions-allowed-in-pattern/66177581#66177581 Continue on glue_restricted above.

Super class

SpectraMapping::MetadataActionBase -> MetadataActionMutate

Methods

Public methods

Inherited methods

Method process_read()

read implementation

Usage
MetadataActionMutate$process_read(data, params)
Arguments
data

MsBackendMapping to execute the metadata mapping step on

params

List of parameters for a single action (one params entry fully merged.)


Method process_write()

write implementation

Usage
MetadataActionMutate$process_write(data, params)
Arguments
data

MsBackendMapping to execute the metadata mapping step on

params

List of parameters for a single action (one params entry fully merged.)


Method clone()

The objects of this class are cloneable with this method.

Usage
MetadataActionMutate$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

backend <- get_proto_backend(temp_rt = c(4,5,6,40,50,60),
                             temp_rt_factor = c(1,1,1,60,60,60))
action <- get_proto_action(
   "mutate",
   source = "temp_rt",
   target = "*rtime",
   required = "temp_rt_factor"
   read = "{temp_rt / temp_rt_factor}",
   write = "{rtime * temp_rt_factor}"
)
fw <- action$execute_read(backend)
fw@variables <- fw@variables %>% select(-temp_rt)
bw <- action$execute_write(fw)


meowcat/SpectraMapping documentation built on May 14, 2024, 6:30 p.m.