metavariable_info {eHDPrep} | R Documentation |
Compute Metavariable Information
Description
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.
Usage
metavariable_info(graph, mode = "in", IC_threshold = 0)
Arguments
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). |
Details
The added attributes are:
- min_dist_to_var
Integer. The minimum distance of an ontology node in the graph to a node representing a dataset variable.
- is_metavariable
Logical. If the node has at least two descendants in the graph which represent dataset variables.
- variable_descendants
List. The names of variables of which a node is an ancestor.
- variable_set
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.
- highest_IC
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
.
Value
A modified graph object with additional node attributes pertaining to their status as a metavariable.
See Also
Other semantic enrichment functions:
join_vars_to_ontol()
,
metavariable_agg()
,
metavariable_variable_descendants()
Examples
data(example_ontology)
require(magrittr)
example_ontology %>%
join_vars_to_ontol(example_mapping_file, root = "root") -> joined_ontol
metavariable_info(joined_ontol)