Linear Model Function Lm() Error: Na/Nan/Inf in Foreign Function Call (Arg 1)

Error saying I have NA/NaN/Inf value when there seems to be none present. Error in hclustfun(distc) : NA/NaN/Inf in foreign function call (arg 11)

Check this row:

ConfP <- Conf.t/rowSums(Conf.t)

It must be evaluating essentially to division by zero:

> 0/0
[1] NaN

> 1/0
[1] Inf

How to run vegan::varpart without having this NA/NaN/Inf in foreign function call (arg 1) message error?

varpart performs variation partition, and for that it needs at least two variables for which to partition the variation. You had only one (Session) – the second one you supplied (LONG) was constant, and hence will explain no variation and was not counted as a variable. We do not check against non-varying "variables", and you get a confusing error message. However, if you are hand-crafting your model with meaningless (constant) "variables", you should expect weird error messages. We could add a test against constants, but somehow it feels strange.



Related Topics



Leave a reply



Submit