fix_items: assign certain children nodes and fill NA for empty fields

View source: R/node.R

fix_itemsR 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")

forestry documentation built on Nov. 21, 2023, 1:07 a.m.