-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
envfit() Error in object$weights #713
Comments
Really hard to give an advice since I cannot reproduce this and there is no reproducible example. I do not even know if this error comes from vegan or from some other package. Element It would be best to have a reproducible example. In lack of that, the minimum is to have |
Only you (@AlexaBennett) can debug this; start from a clean session ( |
@jarioksa not much point keeping this open until the OP posts something we can work with (they can still comment and edit the issue even when closed) |
There is a point of keeping this open because I'm working on this. This looks like a permanent existing problem in |
Oops, sorry - I didn't realise you were actually working on this. Nobbling |
Here is a way to get the same error message (but I do not know if the OP has the same case): library(vegan)
data(dune, dune.env)
mod <- cca(dune)
envfit(mod ~ ., dune.env) # this works
envfit(scores(mod, display="sites") ~ ., dune.env) # this fails, but should work
## Error in object$weights : $ operator is invalid for atomic vectors In old code I solved this by replacing |
@AlexaBennett : I do not have sufficient information of your particular case. I know how to get this error message (when you should not), but I do not know if this solves your problem. I do not even know what was your command that gave the error. However, if it was something like: envfit(x ~ ., x.env) Try replacing this with: envfit(as.data.frame(x) ~ ., x.env) If this fixes your problem, my planned fix will probably solve the same problem. |
The following failed: mod <- rda(dune) envfit(scores(mod, display="sites") ~ ., dune.env) Error in object$weights : $ operator is invalid for atomic vectors
@jarioksa Thank you for following up on this!
The function runs as expected (again). Here is a little added context about the arguments I used. The argument |
The following failed: mod <- rda(dune) envfit(scores(mod, display="sites") ~ ., dune.env) Error in object$weights : $ operator is invalid for atomic vectors (cherry picked from commit eb84ebd)
When running envfit() with vegan_2.6-8, I received the following error message.
The error is produced with:
and
Therefore, I believe a dependency update is causing the issue. Please advise.
The text was updated successfully, but these errors were encountered: