match_branch_to_label: Match branch to label

View source: R/match_branch_to_label.R

match_branch_to_labelR Documentation

Match branch to label

Description

Assume that there are node labels and these may be non-unique. We assign these labels by joining a lookup table of labels and edges with the tree object, in this case the long array format.

Usage

match_branch_to_label(probs_long, probs_from_to_lookup)

Arguments

probs_long

Long format array tree object

probs_from_to_lookup

edge-label look-up table

Details

Separating the tree structure and labelling means that we can reuse the same tree with different labels e.g. another test or treatment

Value

dataframe

See Also

match_branchlabel_to_prob

Examples

probs_long <-
  tibble::tribble(~from, ~to, ~prob,
                  1, 2, 0.5,
                  1, 3, 0.5)
pname_from_to <-
  tibble::tribble(~from, ~to, ~name,
                  1, 2, "pos",
                  1, 3, "neg")

match_branch_to_label(probs_long, pname_from_to)


n8thangreen/CEdecisiontree documentation built on Sept. 13, 2022, 5:25 a.m.