particles icon indicating copy to clipboard operation
particles copied to clipboard

Error: `data` must be uniquely named but has duplicate columns

Open ncchung opened this issue 6 years ago • 13 comments

When I try to run examples presented in this README or its vignette, I get the following error.

Error: data must be uniquely named but has duplicate columns

R version 3.3.3, with latest particles, ggraph, and so on.

ncchung avatar Apr 14 '18 21:04 ncchung

I've just encountered the same error in a different context. May be related to ggplot2 or rlang. This is due to duplicated colnames.

Atrebas avatar Sep 12 '18 14:09 Atrebas

Dropping the duplicate column fixed this issue for me

jsan4christ avatar Oct 15 '18 09:10 jsan4christ

The issue isn't with the R version, but the ggplot2 version. install ggplot2 version 2.2.1 and it should work! require(devtools) install_version("ggplot2", version = "2.2.1", repos = "http://cran.us.r-project.org")

simonlee184 avatar Oct 15 '18 16:10 simonlee184

Error persists. Is there an update on that?

Using an older version is only a temporary solution which might be limiting in some ways.

dtsallos avatar Nov 13 '18 08:11 dtsallos

haven't had time to look into it, but @jsan4christ's solution is generally applicable...

thomasp85 avatar Nov 13 '18 08:11 thomasp85

Well, I have only unique values on my data set and I want to compare the distribution of 2 classes of data (only using aes(x,y, fill= category) ) in geom_boxplot or geom_dotplot with code that works in version 2.2.1 as suggested by @simonlee184. Although, if I try using facets then it won't work. Maybe other issues arise when installing the older version. I need to look into those now too.

In the newer version it tells me that there are duplicates when there aren't any. I checked it using all sorts of commands and removing any possible duplicate.

dtsallos avatar Nov 13 '18 08:11 dtsallos

It is difficult to help without a reproducible example. In general it is complaining about duplicate column names, not duplicate values

thomasp85 avatar Nov 13 '18 08:11 thomasp85

A few things were corrupt in the process of trying to find out what was wrong. Got it all fixed now. Your suggestion to works, just renamed columns this time. Sorry for bothering.

dtsallos avatar Nov 13 '18 09:11 dtsallos

You can use below code which should resolve the issue. colnames(data) <- make.unique(names(data))

deepakag5 avatar Dec 17 '18 17:12 deepakag5

@iamdeepaka, belive me man, you`re the man! After four hours of struggle, I fixed the problem using your suggestions.

canerferhatoglu avatar Sep 06 '19 02:09 canerferhatoglu

@iamdeepaka thank you so much! this solution saved me hours of search

lenabrandt avatar May 01 '20 18:05 lenabrandt

@iamdeepaka I tried your code suggestion, and I was wondering if you had any thoughts about how to approach this error:

> colnames(cds) <- make.unique(names(cds))
Error in make.unique(names(cds)) : 'names' must be a character vector

Since "cds" is a cell_data_set, I wonder if you have to approach making unique names a different way. Thanks in advance!

val23n avatar Aug 10 '20 14:08 val23n

@iamdeepaka I tried your code suggestion, and I was wondering if you had any thoughts about how to approach this error:

> colnames(cds) <- make.unique(names(cds))
Error in make.unique(names(cds)) : 'names' must be a character vector

same question Since "cds" is a cell_data_set, I wonder if you have to approach making unique names a different way. Thanks in advance!

7117summer avatar Nov 29 '20 23:11 7117summer