When I used qiime2R to make a PCOA graph. I’m getting the error:
Error:x
and y
must share the same src, set copy
= TRUE (may be slow).
when running the following command.
library(tidyverse)
library(qiime2R)
metadata <-read_q2metadata("qiime2/metadata.tsv")
head(metadata)
uwunifrac<-read_qza("qiime2/beta filtered/Plastic-filtered-unweighted_unifrac-distance-matrix-pcoa.qza")
shannon<-read_qza("qiime2/alpha filtered/Shannon_Plastic_filtered.qza")
uwunifrac$data$Vectors %>%
select(SampleID, PC1, PC2) %>%
left_join(metadata) %>%
left_join(shannon) %>%
ggplot(aes(x=PC1, y=PC2, color=`Plastic-type`, shape=`Fertilizer-type`, size=shannon)) +
geom_point(alpha=0.5) + #alpha controls transparency and helps when points are overlapping
theme_q2r() +
scale_shape_manual(values=c(16,15,14), name="Fertilizer-type") + #see http://www.sthda.com/sthda/RDoc/figure/graphs/r-plot-pch-symbols-points-in-r.png for numeric shape codes
scale_size_continuous(name="Shannon Diversity") +
scale_color_discrete(name="Plastic type")
ggsave("Plastic-filtered-unweighted_unifrac-pcoa.pdf", height=4, width=5, device="pdf") # save a PDF 3 inches by 4 inches
What should I do to solve it?