Hi all, I am working with my data following the tutorial I mentioned in the title, and when I try to do the PCoA as indicated in the tutorial I get the following error:
Error occurred in the 1st layer.
Caused by error in check_aesthetics()
:
! Aesthetics must be either length 1 or the same as the data (32)
Fix the following mappings: size
I am attaching my data just in case
and my code is the following
metadatartl2<-read_q2metadata("muestra-metadatos-rtl.tsv")
uwunifracrtl2<-read_qza("unweighted_unifrac_pcoa_results-rtl-2.qza")
shannonrtl2<-read_qza("shannon_vector-rtl2.qza")$data %>% rownames_to_column("SampleID")
uwunifracrtl2$data$Vectors %>%
select(SampleID, PC1, PC2) %>%
left_join(metadatartl2) %>%
left_join(shannonrtl2) %>%
ggplot(aes(x=PC1, y=PC2, color=depth
, shape=year
, size=shannonrtl2)) +
geom_point(alpha=0.5) +
theme_q2r() +
scale_shape_manual(values=c(16,1), name="Camp") +
scale_size_continuous(name="Shannon Diversity") +
scale_color_discrete(name="Depth")
ggsave("PCoA.pdf", height=4, width=5, device="pdf")
Has anyone else had this error? Any idea how I can fix it?
It would be a great help, THANKS!
sample-metadata-rtl.tsv (1.5 KB)
shannon_vector-rtl2.qza (63.5 KB)
unweighted_unifrac_pcoa_results-rtl-2.qza (81.1 KB)