Skip to contents

Identifies which mcnodes within an mcmodule contain infinite values (Inf or -Inf). Useful for troubleshooting and debugging Monte Carlo models.

Usage

which_mcnode_inf(mcmodule)

Arguments

mcmodule

(mcmodule object). Module containing node_list.

Value

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

Examples

# Find nodes with infinite values in the imports_mcmodule
which_mcnode_inf(imports_mcmodule)
#> character(0)

# Create a test mcmodule with Inf values
test_mcnode_inf <- mcdata(c(0.1, Inf, 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_inf),
    node_b = list(mcnode = test_mcnode_clean)
  )
)
which_mcnode_inf(test_mcmodule)
#> [1] "node_a"