Qiime2 and R downstream analysis

Thank you very much for getting back to me. I tried to workaround per this and it worked.

However, I encountered another issue running evenness. I ran the code below for evenness:

metadata %>%
filter(!is.na(evenness)) %>%
ggplot(aes(x=Age, y= evenness, color=Practice)) +
stat_summary(geom="errorbar", fun.data=mean_se, width=0) +
stat_summary(geom="line", fun.data=mean_se) +
stat_summary(geom="point", fun.data=mean_se) +
xlab("Age") +
ylab("evenness") +
theme_q2r() + # try other themes like theme_bw() or theme_classic()
scale_color_viridis_d(name="Practice") # use different color scale which is color blind friendly
ggsave("evenness_by_time.pdf", height=3, width=4, device="pdf") # save a PDF 3 inches by 4 inches

The error message I got is below:

Error in filter():
! Problem while computing ..1 = !is.na(evenness).
:heavy_multiplication_x: Input ..1 must be of size 778 or 1, not size 702.
Run rlang::last_error() to see where the error occurred.

I checked that 702 samples have been merged and Pielou's Evenness column has been added to the metadata.

I see from other posts that it seems the code worked for them with no issues when running the evenness, but I am having an issue. Can you please pinpoint a lead that is likely causing the error?

Thank you very much!

1 Like