You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've noticed that adonis2() returns the following error when using the notation adonis2(formula, data), e.g.:
library(palmerpenguins)
library(vegan)
penguins <- penguins[!is.na(penguins$bill_length_mm),]
# Works fine
adonis(bill_length_mm~species*island,
data = penguins,
method = "euclidean")
#Outputs the error
adonis2(bill_length_mm~species*island,
data = penguins,
method = "euclidean")
#Error in eval(YVAR, environment(formula), globalenv()) :
# object 'bill_length_mm' not found
#However, if instead of using formula, I specify the data using $, it works as expected
adonis2(penguins$bill_length_mm~penguins$species*penguins$island,
method = "euclidean")
The text was updated successfully, but these errors were encountered:
formula: Model formula. The left-hand side (LHS) of the formula must
be either a community data matrix or a dissimilarity matrix,
e.g., from ‘vegdist’ or ‘dist’. If the LHS is a data matrix,
function ‘vegdist’ will be used to find the dissimilarities.
The right-hand side (RHS) of the formula defines the
independent variables. These can be continuous variables or
factors, they can be transformed within the formula, and they
can have interactions as in a typical ‘formula’.
data: the data frame for the independent variables.
In your example bill_length_mm is not among accepted alternatives for the LHS in a formula. Please note, that data will be only used for the variables on the RHS (independet variables).
I've noticed that adonis2() returns the following error when using the notation adonis2(formula, data), e.g.:
The text was updated successfully, but these errors were encountered: