These function supplement a entity nodes with clustered entity values from other entities specified in the target entity nodes. Both the target entity and the source entity have to be clustering entities. Use supplement_data_from_list_inSingleNode() for one entity node, and supplement_data_from_list_inRxsProject() for all nodes containing the field that identifies the node to copy the values from (i.e. as specified in sourceEntityNodeIdField_in_targetEntity).

supplement_data_from_list_inRxsProject(
  x,
  sourceEntityNodeIdField_in_targetEntity,
  idField_in_targetEntityNode = NULL,
  idField_in_sourceEntityNode = NULL,
  fieldsToCopy_regex = NULL,
  sourcePathString_regex = NULL,
  targetPathString_regex = NULL,
  forceCopyingOfExistingValues = FALSE,
  prefix = "supplemented_",
  suffix = "",
  silent = metabefor::opts$get("silent")
)

supplement_data_from_list_inSingleNode(
  rxsTree,
  targetEntityNodeId,
  sourceEntityNodeIdField_in_targetEntity,
  idField_in_targetEntityNode = NULL,
  idField_in_sourceEntityNode = NULL,
  fieldsToCopy_regex = NULL,
  forceCopyingOfExistingValues = FALSE,
  sourcePathString_regex = NULL,
  targetPathString_regex = NULL,
  prefix = "supplemented_",
  suffix = "",
  silent = metabefor::opts$get("silent")
)

supplement_data_from_lists(
  rxsTree,
  sourceEntityNodeIdField_in_targetEntity,
  idField_in_targetEntityNode = NULL,
  idField_in_sourceEntityNode = NULL,
  fieldsToCopy_regex = NULL,
  sourcePathString_regex = NULL,
  targetPathString_regex = NULL,
  forceCopyingOfExistingValues = FALSE,
  prefix = "supplemented_",
  suffix = "",
  silent = metabefor::opts$get("silent")
)

Arguments

x

Either a single Rxs tree or an object with parsed Rxs files.

sourceEntityNodeIdField_in_targetEntity

Inside the target entity node, the name holding the identifier of the source entity node (the node supplying the data). Note that that field is itself an entity as specified in the entity specification spreadsheet.

idField_in_targetEntityNode

NULL if the target node's name is also its identifier; otherwise, the name of the field containing the identifier in the target node.

idField_in_sourceEntityNode

NULL if the source node's name is also its identifier; otherwise, the name of the field containing the identifier in the source node.

fieldsToCopy_regex

A regular expression that can optionally be used to select fields to copy over from the source node to the target node.

sourcePathString_regex, targetPathString_regex

Regular expressions that must match the path string of the source of target node.

forceCopyingOfExistingValues

Whether to force copying (and so overwriting) existing values if encountered in the target entity. If FALSE, existing values will not be overwritten.

prefix, suffix

A text string to prepend and append to the names of the values that are copied.

silent

Whether to be quiet or chatty.

rxsTree

The Rxs tree

targetEntityNodeId

The identifier of the target entity node (the node to supplement)

Value

Invisibly, the (altered) input - but note that since the data.tree package uses R6's pass-by-reference semantics, that object is altered in place, and sothe returned object can be discarded.