This function takes a full Rxs project object (as produced by rxs_parseExtractionScripts()) and processes all Rxs trees, looking for entities that match the entityId_regex regular expression (for information about what clustering entities are, see https://r-packages.gitlab.io/metabefor/articles/definitions.html) and passes those to function fun, passing the entity's value as the argument named in entityValue_argName and with funArgs as additional arguments.

transform_entityValue(
  x,
  fun,
  entityValue_argName = "x",
  entityId_regex = NULL,
  newEntityName_prefix = "",
  newEntityName_suffix = "_trfmd",
  funArgs = NULL,
  requiredField_regex = NULL
)

Arguments

x

The full Rxs project object (as produced by rxs_parseExtractionScripts()).

fun

The function to apply.

entityValue_argName

The argument name to pass the entity value as.

entityId_regex

An optional regular expression: if specified, only entity nodes with entity identifiers that match this regular expression will be processed.

newEntityName_prefix, newEntityName_suffix

The prefix and suffix to add to the entity identifier to create the name of the new entity that is created. That entity is added as a sibling of the target entity.

funArgs

Additional arguments, as a names list with each element's name is the argument name and the element itself the content.

requiredField_regex

This functionality has not yet been implemented.

Value

Invisibly, the full Rxs project object. Note that the Rxs trees will be changed in place given data.tree's pass-by-reference logic; so you can discard the result.