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

**URL:** https://forum.qiime2.org/t/qiime-2r-error-x-and-y-must-share-the-same-src-set-copy-true-may-be-slow/17786
**Category:** Other Bioinformatics Tools
**Tags:** qiime2-r
**Created:** [December 14, 2020, 3:16am UTC](https://forum.qiime2.org/t/qiime-2r-error-x-and-y-must-share-the-same-src-set-copy-true-may-be-slow/17786 "2020-12-14T03:16:46Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![YuZhang](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yuzhang/32/11537_2.png) [@YuZhang](https://forum.qiime2.org/u/YuZhang)
#### Post date: [December 14, 2020, 3:16am UTC](https://forum.qiime2.org/t/qiime-2r-error-x-and-y-must-share-the-same-src-set-copy-true-may-be-slow/17786/1 "2020-12-14T03:16:46Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![jbisanz](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jbisanz/32/1720_2.png) [@jbisanz](https://forum.qiime2.org/u/jbisanz)
#### Post date: [December 14, 2020, 6:09pm UTC](https://forum.qiime2.org/t/qiime-2r-error-x-and-y-must-share-the-same-src-set-copy-true-may-be-slow/17786/2 "2020-12-14T18:09:44Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![YuZhang](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yuzhang/32/11537_2.png) [@YuZhang](https://forum.qiime2.org/u/YuZhang)
#### Post date: [December 15, 2020, 2:09am UTC](https://forum.qiime2.org/t/qiime-2r-error-x-and-y-must-share-the-same-src-set-copy-true-may-be-slow/17786/3 "2020-12-15T02:09:37Z")

</div>

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)

```

---

<div class="post-metadata">

### Author: ![YuZhang](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yuzhang/32/11537_2.png) [@YuZhang](https://forum.qiime2.org/u/YuZhang)
#### Post date: [December 15, 2020, 6:48am UTC](https://forum.qiime2.org/t/qiime-2r-error-x-and-y-must-share-the-same-src-set-copy-true-may-be-slow/17786/4 "2020-12-15T06:48:14Z")

</div>

Thank you,but may be not.

> [@qiime 2R-Error:\`x\` and \`y\` must share the same src, set \`copy\` = TRUE (may be slow).](https://forum.qiime2.org/t/qiime-2r-error-x-and-y-must-share-the-same-src-set-copy-true-may-be-slow/17786/3):
>
> 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)
