validate_ds {rollupTree} | R Documentation |
Validates a data set for use with rollup()
Description
validate_ds()
ensures that a data set contains the same identifiers as a specified tree and that
elements of the data set corresponding to leaf vertices in the tree satisfy a user-specified predicate.
Usage
validate_ds(
tree,
ds,
get_keys,
get_prop,
op = function(x) is.numeric(x) & !is.na(x)
)
Arguments
tree |
|
ds |
data set to be updated; can be any object |
get_keys |
function to get keys of the data set called as |
get_prop |
function to get the property value to validate for leaf element with id |
op |
logical function to test return value of |
Value
TRUE if validation succeeds, halts otherwise
Examples
validate_ds(wbs_tree, wbs_table, function(d) d$id, function(d, l) d[d$id == l, "work"])
[Package rollupTree version 0.3.2 Index]