supplement_data_with_value.Rd
This function supplements an entity node with a value from another entity
node. Note that the source entity cannot be a clustering entity (i.e.
the value stored for that entity must be a single value); and the target
entity must be a clustering entity (i.e. the value stored for that entity
must be a list of values for clustered entities).
Whereas for supplement_data_with_value_inSingleNode()
,
you have to specify
the entity identifier for the entity you want to supplement, for
supplement_data_with_value_inRxsProject()
,
use targetPathString_regex
to
specify which entities you would like to supplement (i.e. copy the relevant
value to). Of course, this can also be an entity identifier if you only want
to copy to a single entity but in all Rxs trees in an object with parsed
Rxs files.
supplement_data_with_value_inRxsProject(
x,
sourceEntityNodeId,
targetEntityNodeId = NULL,
targetEntityNode_requiredField = NULL,
forceCopyingOfExistingValues = FALSE,
sourcePathString_regex = NULL,
targetPathString_regex = NULL,
targetNodeListCreation_prefix = "",
targetNodeListCreation_suffix = "_value",
prefix = "supplemented_",
suffix = "",
flattenVectors = FALSE,
silent = metabefor::opts$get("silent")
)
supplement_data_with_value_inSingleNode(
rxsTree,
targetEntityNodeId,
sourceEntityNodeId,
forceCopyingOfExistingValues = FALSE,
sourcePathString_regex = NULL,
targetPathString_regex = NULL,
targetNodeListCreation_prefix = "",
targetNodeListCreation_suffix = "_value",
prefix = "supplemented_",
suffix = "",
flattenVectors = FALSE,
silent = metabefor::opts$get("silent")
)
The identifier of the source entity node.
The identifier of the target entity node (the entity node to supplement)
A required field that, if it does not occur in the target entity, causes that target entity to be skipped. This provides additional control over which target entities to process.
Whether to force copying (and so
overwriting) existing values if encountered in the target entity. If
FALSE
, existing values will not be overwritten.
Regular expressions that must match the path string of the source of target node.
A prefix and suffix to add when a list is created.
A text string to prepend and append to the entity identifier when copying it to the target entity.
Whether to flatten vectors when copying them over.
Whether to be quiet or chatty.
The Rxs tree or the Rxs project object.
Invisibly, the (altered) Rxs tree - but note that since
the data.tree
package uses R6
's pass-by-reference semantics, that object
is altered in place, and so the returned object can be discarded.