-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Hi,
I am trying to run the plot_anova_diversity function but it produces an error:
plot_anova_diversity(physeq1, method = "shannon", grouping_column = "Type")
Error in names(df_pw) <- c("measure", "from", "to", "y", "p") : 'names' attribute [5] must be the same length as the vector [1]
My grouping column "Type" has 2 levels. The function produces the anova_diversity.cvs but it contains rows with measures of diversity that I did not specify (e.g. richness and simpson). When I re-run plot_anova_diversity with the 3 measures of diversity as in the tutorial, the error changes slightly:
plot_anova_diversity(physeq1, method = c("richness","simpson", "shannon"), grouping_column = "Type")
Error in data.frame(x = c(which(levels(df[, grouping_column]) == as.character(df_pw[i, : arguments imply differing number of rows: 0, 2
Since I can run anova and calculate diversity manually on my phyloseq1 object, I tracked the source of the issue to the perform_anova function and the way it creates the df_pw data frame, but I am stuck there and can't figure out what's wrong. The anova_diversity.cvs has all 6 columns and I don't know what the "vector" in the first error message refers to.
Is this an error in the code? Or what am I missing? Any hints would be very appreciated.