get_stage {stagedtrees} | R Documentation |
Get stage or path
Description
Utility functions to obtain stages from paths and paths from stages.
Usage
get_stage(object, path)
get_path(object, var, stage)
Arguments
object |
an object of class |
path |
character vector, the path from root or a two dimensional array where each row is a path from root. |
var |
character, one of the variable in the staged tree. |
stage |
character vector, the name of the stages for which the paths should be returned. |
Value
get_stage
returns
the stage name(s) for given path(s).
get_path
returns a
data.frame containing the paths
corresponding to the given stage(s).
Examples
model <- stages_fbhc(full(PhDArticles))
get_stage(model, c("0", "male"))
paths <- expand.grid(model$tree[2:1])[, 2:1]
get_stage(model, paths)
get_path(model, "Kids", "5")
get_path(model, "Gender", "2")
get_path(model, "Kids", c("5", "6"))
[Package stagedtrees version 2.3.0 Index]