An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090428/a13b6536/attachment-0001.pl>
duplicate 'row.names' are not allowed
3 messages · amor Gandhi, Gabor Grothendieck, Uwe Ligges
You are trying to create an illegal object, i.e. a data.frame with duplicate row names so its correctly signally the error. Read the definition of data.frame in ?data.frame
On Tue, Apr 28, 2009 at 8:04 AM, amor Gandhi <amorigandhi at yahoo.de> wrote:
Hi everyone,
I have got the following problem:
x1 <- rnorm(10,5,1)
x2 <- runif(10,0,1)
nam1 <- paste("A",1:4,sep=".")
nam2 <- paste("A",6:9,sep=".")
nam <- c(nam1,"A.4",nam2,"A.9")
mydata <- data.frame(x1,x2)
rownames(mydata) <- nam
Error in `row.names<-.data.frame`(`*tmp*`, value = c("A.1", "A.2", "A.3", :
duplicate 'row.names' are not allowed
In addition: Warning message:
non-unique values when setting 'row.names': ?A.4?, ?A.9?
I am very thankful for your help!
Amor
? ? ? ?[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
amor Gandhi wrote:
Hi everyone,
?
I have got the following problem:
?
x1 <- rnorm(10,5,1)
x2 <- runif(10,0,1)
nam1 <- paste("A",1:4,sep=".")
nam2 <- paste("A",6:9,sep=".")
nam <- c(nam1,"A.4",nam2,"A.9")
mydata <- data.frame(x1,x2)
rownames(mydata) <- nam
Error in `row.names<-.data.frame`(`*tmp*`, value = c("A.1", "A.2", "A.3", :
duplicate 'row.names' are not allowed
This message suggests that you have to choose unique row.names ... or assign those values as an additional column in your data.frame, if you need non unique values. Uwe Ligges
In addition: Warning message:
non-unique values when setting 'row.names': ???A.4???, ???A.9???
?
I am very thankful for your help!
?
Amor
[[alternative HTML version deleted]]
------------------------------------------------------------------------
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.