I got some NaNs in for some standard errors in my multinomial regression output (nnet package, formula multinom(). Now I want R to ignore these NaNs , for example in replacing them as zero. I tried the following code
unstack(within(stack(z$standard.error), values[is.nan(values)] <- 0))
with z as the summary test result. But it doesn't work. Is there a way to solve this problem? Thank you in advance