Hello to all
I am following the Tutorial: Integrating QIIME2 and R for data visualization and analysis using qiime2R with my own data, and I have no problems so far from alpha, here I have an error to run the following command:
metadata %>%
filter(!is.na(shannon)) %>%
ggplot(aes(x=days-since-experiment-start
, y=shannon, color=body-site
)) +
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("Days") +
ylab("Shannon Diversity") +
theme_q2r() + # try other themes like theme_bw() or theme_classic()
scale_color_viridis_d(name="Body Site") # use different color scale which is color blind friendly
ggsave("Shannon_by_time.pdf", height=3, width=4, device="pdf") # save a PDF 3 inches by 4 inches
The error is:
Error in filter()
:
! Problem while computing ..1 = !is.na(shannon)
.
Input
..1
must be a logical vector, not a logical[,2].
i don't understand what it refers to.
And when I try to do the same with the example data provided in the tutorial, I get the following error:
Error in filter()
:
! Problem while computing ..1 = !is.na(shannonqm)
.
Input
..1
must be of size 34 or 1, not size 31
I don't know what I am doing wrong, when I follow all the steps in the tutorial.
I want to add that I tried with as.data.frame to shannon, but when I do it, the number of variables in the data frame is 0:
shannon<-shannon$data %>% as.data.frame(shannon) %>% rownames_to_column("SampleID")
I hope you can help me, as I have been all afternoon trying
Thank you!
Pd: I will attach my metadata table and shannon vector just in case.
sample-metadata.tsv (2.5 KB)
shannon_vector.qza (97.3 KB)