Learn R Programming

mcmodule (version 1.2.0)

which_mcnode_na: Find mcnodes with Missing Values

Description

Find mcnodes with Missing Values

Usage

which_mcnode_na(mcmodule)

Value

Character vector of mcnode names containing NA values. Returns empty vector if no NAs found.

Arguments

mcmodule

(mcmodule object). Module containing node_list.

Details

Identifies which mcnodes within an mcmodule contain NA values. Useful for troubleshooting and debugging Monte Carlo models.

See Also

which_mcnode(), which_mcnode_inf(), mcnode_na_rm()

Examples

Run this code
# Find nodes with NAs in the imports_mcmodule
which_mcnode_na(imports_mcmodule)

# 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)

Run the code above in your browser using DataLab