metavariable_info {eHDPrep} | R Documentation |
Calculates attributes for each node in a graph object pertaining to their
suitability and rank as metavariables; primarily if they are the most
informative common ancestor (see node_IC_zhou
) of a set of
nodes representing a dataset variable.
metavariable_info(graph, mode = "in", IC_threshold = 0)
graph |
Graph containing ontological and dataset nodes. Must be in
|
mode |
Character constant specifying the directionality of the edges. One of: "in" or "out". |
IC_threshold |
Metavariables with IC less than this value will be omitted from output. Default = 0 (no omission). |
The added attributes are:
Integer. The minimum distance of an ontology node in the graph to a node representing a dataset variable.
Logical. If the node has at least two descendants in the graph which represent dataset variables.
List. The names of variables of which a node is an ancestor.
Integer. An identifier for the unique set of descendants in the graph which represent dataset variables. The assigned number corresponds to the order in which a unique set was identified when scanning through the node table.
Logical. If the node possesses the highest information
content of all other nodes which are common ancestors of the same variable
set. Information content is expected to have been calculated in
join_vars_to_ontol
.
A modified graph object with additional node attributes pertaining to their status as a metavariable.
Other semantic enrichment functions:
join_vars_to_ontol()
,
metavariable_agg()
,
metavariable_variable_descendants()
data(example_ontology)
require(magrittr)
example_ontology %>%
join_vars_to_ontol(example_mapping_file, root = "root") -> joined_ontol
metavariable_info(joined_ontol)