Learn R Programming

forestry (version 0.1.1)

fill_NA_level: fill missing value of a field across a level with 0

Description

fill missing value of a field across a level with 0

Usage

fill_NA_level(input_node, field_name, by_level, fill_with = 0)

Value

node with NA filled for the input field at input level

Arguments

input_node

input node

field_name

field for this operation

by_level

across this level

fill_with

fill missing value with this value

Examples

Run this code
data(exercise_df)
exercise_node <- data.tree::as.Node(exercise_df)
result <- fill_NA_level(input_node = exercise_node,
                        field_name = "exercise_time",
                        by_level = 2,
                        fill_with = "quarterly")
print(result, "exercise_time")

Run the code above in your browser using DataLab