qiime 2R-Error:`x` and `y` must share the same src, set `copy` = TRUE (may be slow).

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?

I think this is coming from the dplyr package. Are you working on a remote server? Try moving the files to your local machine and/or updating your version of dplyr.

I think I solved this problem by edit the shannon file,like this

#moves the sample names to a new column that matches the metadata and allows them to be merged
shannon<-shannon$data %>% rownames_to_column("SampleID")
head(shannon)

Thank you,but may be not.

1 Like