I ran a vensim xmile file and encountered the following error:
Error in sum(undefined_vars) : invalid 'type' (list) of argument
the reason seems to be rh_vars is empty which I fixed by adding the following in this line. This makes sure sum(undefined_vars) happens only when undefined_vars is nonempty.
if(length(undefined_vars) != 0){
n_und_var <- sum(undefined_vars)
}
else{
n_und_var <- 0
}
I ran a vensim xmile file and encountered the following error:
Error in sum(undefined_vars) : invalid 'type' (list) of argumentthe reason seems to be
rh_varsis empty which I fixed by adding the following in this line. This makes suresum(undefined_vars)happens only whenundefined_varsis nonempty.