fix_items {forestry}R Documentation

assign certain children nodes and fill NA for empty fields

Description

assign certain children nodes and fill NA for empty fields

Usage

fix_items(fix_vector, input_node)

Arguments

fix_vector

children node names to be assigned

input_node

the node to be exapnded with children's names

Value

a node expanded with certain children nodes

Examples

cell_node2 <- data.tree::Node$new("cell2")
cell_node2$AddChild("B")
cell_node2$AddChild("C")
cell_node2$Set(class = c(NA, "B1", "C1"))
print(cell_node2, "class")
cell_fixed_items <- fix_items(fix_vector = c("A", "B", "C", "D"), input_node = cell_node2)
print(cell_fixed_items, "class")

[Package forestry version 0.1.1 Index]