MetadataActionMutate | R Documentation |
Metadata action: mutate
Metadata action: mutate
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.
SpectraMapping::MetadataActionBase
-> MetadataActionMutate
process_read()
read implementation
MetadataActionMutate$process_read(data, params)
data
MsBackendMapping
to execute the metadata mapping step on
params
List of parameters for a single action (one params
entry fully merged.)
process_write()
write implementation
MetadataActionMutate$process_write(data, params)
data
MsBackendMapping
to execute the metadata mapping step on
params
List of parameters for a single action (one params
entry fully merged.)
clone()
The objects of this class are cloneable with this method.
MetadataActionMutate$clone(deep = FALSE)
deep
Whether to make a deep clone.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.