Find mcnodes with Missing Values
Details
Identifies which mcnodes within an mcmodule contain NA values. Useful for troubleshooting and debugging Monte Carlo models.
Examples
# Find nodes with NAs in the imports_mcmodule
which_mcnode_na(imports_mcmodule)
#> character(0)
# Create a test mcmodule with NAs
test_mcnode_na <- mcdata(c(0.1, NA, 0.3), type = "0", nvariates = 3)
test_mcnode_clean <- mcdata(c(0.1, 0.2, 0.3), type = "0", nvariates = 3)
test_mcmodule <- list(
node_list = list(
node_a = list(mcnode = test_mcnode_na),
node_b = list(mcnode = test_mcnode_clean)
)
)
which_mcnode_na(test_mcmodule)
#> [1] "node_a"
