Re: [R] Error when naming rows of dataset
At 17:30 24/10/2006, yongchuan wrote: I get the following error when I try reading in a table. How are 1.1, 1.2, 1.3 duplicate row names? Thx. R gives you brief details of where it was when it fell over. Have you checked in latestWithNumber.txt' to see whether R is right? table - read.table('latestWithNumber.txt', header=T) Error in row.names-.data.frame(`*tmp*`, value = c(1.1, 1.2, 1.3, : duplicate 'row.names' are not allowed Yongchuan Michael Dewey http://www.aghmed.fsnet.co.uk __ R-help@stat.math.ethz.ch 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.
Re: [R] Error when naming rows of dataset
I'm pretty new with R, so the only error message I see is the below that I pasted. I'm attaching the first few rows of the file for reference. The layout looks screwy when I attach it here but 'Start' to 'closingCoupon' is the first row in the .txt file. Thx! Start StopPrepayDate modBalance closingCoupon 1.1 6 7 0 811.27698.35 1.2 7 8 0 811.27698.35 1.3 8 9 1 811.27698.35 2.1 4 5 0 2226.0825 8.7 2.2 5 6 0 2226.0825 8.7 2.3 6 7 0 2226.0825 8.7 2.4 7 8 0 2226.0825 8.7 2.5 8 9 0 2226.0825 8.7 2.6 9 10 0 2226.0825 8.7 2.7 10 11 0 2226.0825 8.7 2.8 11 12 0 2226.0825 8.7 2.9 12 13 0 2226.0825 8.7 2.1 13 14 0 2226.0825 8.7 From: Michael Dewey [EMAIL PROTECTED] Date: Wed 25/10/2006 6:38 PM SGT To: yongchuan [EMAIL PROTECTED], r-help@stat.math.ethz.ch Subject: Re: [R] Error when naming rows of dataset At 17:30 24/10/2006, yongchuan wrote: I get the following error when I try reading in a table. How are 1.1, 1.2, 1.3 duplicate row names? Thx. R gives you brief details of where it was when it fell over. Have you checked in latestWithNumber.txt' to see whether R is right? table - read.table('latestWithNumber.txt', header=T) Error in row.names-.data.frame(`*tmp*`, value = c(1.1, 1.2, 1.3, : duplicate 'row.names' are not allowed Yongchuan Michael Dewey http://www.aghmed.fsnet.co.uk __ R-help@stat.math.ethz.ch 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.
Re: [R] Error when naming rows of dataset
yongchuan [EMAIL PROTECTED] writes: I'm pretty new with R, so the only error message I see is the below that I pasted. I'm attaching the first few rows of the file for reference. The layout looks screwy when I attach it here but 'Start' to 'closingCoupon' is the first row in the .txt file. Thx! Start StopPrepayDate modBalance closingCoupon 1.1 6 7 0 811.27698.35 1.2 7 8 0 811.27698.35 1.3 8 9 1 811.27698.35 2.1 4 5 0 2226.0825 8.7 2.2 5 6 0 2226.0825 8.7 2.3 6 7 0 2226.0825 8.7 2.4 7 8 0 2226.0825 8.7 2.5 8 9 0 2226.0825 8.7 2.6 9 10 0 2226.0825 8.7 2.7 10 11 0 2226.0825 8.7 2.8 11 12 0 2226.0825 8.7 2.9 12 13 0 2226.0825 8.7 2.1 13 14 0 2226.0825 8.7 I see two rows called 2.1... (BTW, data seem to be TAB separated. If so, read.delim may be a better idea than read.table. E.g., it will cause you less grief in case of empty cells.) From: Michael Dewey [EMAIL PROTECTED] Date: Wed 25/10/2006 6:38 PM SGT To: yongchuan [EMAIL PROTECTED], r-help@stat.math.ethz.ch Subject: Re: [R] Error when naming rows of dataset At 17:30 24/10/2006, yongchuan wrote: I get the following error when I try reading in a table. How are 1.1, 1.2, 1.3 duplicate row names? Thx. R gives you brief details of where it was when it fell over. Have you checked in latestWithNumber.txt' to see whether R is right? table - read.table('latestWithNumber.txt', header=T) Error in row.names-.data.frame(`*tmp*`, value = c(1.1, 1.2, 1.3, : duplicate 'row.names' are not allowed Yongchuan Michael Dewey http://www.aghmed.fsnet.co.uk __ R-help@stat.math.ethz.ch 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. -- O__ Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 __ R-help@stat.math.ethz.ch 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.
Re: [R] Error when naming rows of dataset
At 12:44 25/10/2006, yongchuan wrote: I'm pretty new with R, so the only error message I see is the below that I pasted. I'm attaching the first few rows of the file for reference. You seem to have 2 rows called 2.1 The layout looks screwy when I attach it here but 'Start' to 'closingCoupon' is the first row in the .txt file. Thx! Start StopPrepayDate modBalance closingCoupon 1.1 6 7 0 811.27698.35 1.2 7 8 0 811.27698.35 1.3 8 9 1 811.27698.35 2.1 4 5 0 2226.0825 8.7 2.2 5 6 0 2226.0825 8.7 2.3 6 7 0 2226.0825 8.7 2.4 7 8 0 2226.0825 8.7 2.5 8 9 0 2226.0825 8.7 2.6 9 10 0 2226.0825 8.7 2.7 10 11 0 2226.0825 8.7 2.8 11 12 0 2226.0825 8.7 2.9 12 13 0 2226.0825 8.7 2.1 13 14 0 2226.0825 8.7 From: Michael Dewey [EMAIL PROTECTED] Date: Wed 25/10/2006 6:38 PM SGT To: yongchuan [EMAIL PROTECTED], r-help@stat.math.ethz.ch Subject: Re: [R] Error when naming rows of dataset At 17:30 24/10/2006, yongchuan wrote: I get the following error when I try reading in a table. How are 1.1, 1.2, 1.3 duplicate row names? Thx. R gives you brief details of where it was when it fell over. Have you checked in latestWithNumber.txt' to see whether R is right? table - read.table('latestWithNumber.txt', header=T) Error in row.names-.data.frame(`*tmp*`, value = c(1.1, 1.2, 1.3, : duplicate 'row.names' are not allowed Yongchuan Michael Dewey http://www.aghmed.fsnet.co.uk -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.408 / Virus Database: 268.13.11/496 - Release Date: 24/10/2006 Michael Dewey http://www.aghmed.fsnet.co.uk __ R-help@stat.math.ethz.ch 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.
Re: [R] Error when naming rows of dataset
On 10/25/2006 7:44 AM, yongchuan wrote: I'm pretty new with R, so the only error message I see is the below that I pasted. What caught you is that R truncates the text when it prints an error. So it only listed the first 3 row names, which are unique, and didn't point out that the real problem was with the last one. This is very common in R error messages: the errors are usually less specific than they could be. For instance, the code that detects the duplicate can easily determine which rows are duplicates, and could tell you that, but it doesn't. Unfortunately, because this is so common, it would really require a lot of work to fix. It would also dump a lot of work on the translation teams, because the new error messages would all need to be translated. Doing it would introduce new errors, and since they'd only show up in error conditions, they'd likely be missed. So it's not even the kind of project that one person could take on, it would need the cooperation of several. Sorry for going so far afield from your specific problem, but I think it's useful for new R users to know R's limitations, and some of the reasons for them. Duncan Murdoch I'm attaching the first few rows of the file for reference. The layout looks screwy when I attach it here but 'Start' to 'closingCoupon' is the first row in the .txt file. Thx! Start StopPrepayDate modBalance closingCoupon 1.1 6 7 0 811.27698.35 1.2 7 8 0 811.27698.35 1.3 8 9 1 811.27698.35 2.1 4 5 0 2226.0825 8.7 2.2 5 6 0 2226.0825 8.7 2.3 6 7 0 2226.0825 8.7 2.4 7 8 0 2226.0825 8.7 2.5 8 9 0 2226.0825 8.7 2.6 9 10 0 2226.0825 8.7 2.7 10 11 0 2226.0825 8.7 2.8 11 12 0 2226.0825 8.7 2.9 12 13 0 2226.0825 8.7 2.1 13 14 0 2226.0825 8.7 From: Michael Dewey [EMAIL PROTECTED] Date: Wed 25/10/2006 6:38 PM SGT To: yongchuan [EMAIL PROTECTED], r-help@stat.math.ethz.ch Subject: Re: [R] Error when naming rows of dataset At 17:30 24/10/2006, yongchuan wrote: I get the following error when I try reading in a table. How are 1.1, 1.2, 1.3 duplicate row names? Thx. R gives you brief details of where it was when it fell over. Have you checked in latestWithNumber.txt' to see whether R is right? table - read.table('latestWithNumber.txt', header=T) Error in row.names-.data.frame(`*tmp*`, value = c(1.1, 1.2, 1.3, : duplicate 'row.names' are not allowed Yongchuan Michael Dewey http://www.aghmed.fsnet.co.uk __ R-help@stat.math.ethz.ch 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. __ R-help@stat.math.ethz.ch 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.
Re: [R] Error when naming rows of dataset
On Wed, 25 Oct 2006, yongchuan wrote: I'm pretty new with R, so the only error message I see is the below that I pasted. Which you misread: did you not notice it ended with a comma? I'm attaching the first few rows of the file for reference. The layout looks screwy when I attach it here but 'Start' to 'closingCoupon' is the first row in the .txt file. Thx! Start StopPrepayDate modBalance closingCoupon 1.1 6 7 0 811.27698.35 1.2 7 8 0 811.27698.35 1.3 8 9 1 811.27698.35 2.1 4 5 0 2226.0825 8.7 2.2 5 6 0 2226.0825 8.7 2.3 6 7 0 2226.0825 8.7 2.4 7 8 0 2226.0825 8.7 2.5 8 9 0 2226.0825 8.7 2.6 9 10 0 2226.0825 8.7 2.7 10 11 0 2226.0825 8.7 2.8 11 12 0 2226.0825 8.7 2.9 12 13 0 2226.0825 8.7 2.1 13 14 0 2226.0825 8.7 There are two rows named '2.1' there, so your problem is already evident. Row names must be unique, as it says in ?data.frame and in many other places in the R documentation. From: Michael Dewey [EMAIL PROTECTED] Date: Wed 25/10/2006 6:38 PM SGT To: yongchuan [EMAIL PROTECTED], r-help@stat.math.ethz.ch Subject: Re: [R] Error when naming rows of dataset At 17:30 24/10/2006, yongchuan wrote: I get the following error when I try reading in a table. How are 1.1, 1.2, 1.3 duplicate row names? Thx. R gives you brief details of where it was when it fell over. Have you checked in latestWithNumber.txt' to see whether R is right? table - read.table('latestWithNumber.txt', header=T) Error in row.names-.data.frame(`*tmp*`, value = c(1.1, 1.2, 1.3, : duplicate 'row.names' are not allowed Yongchuan Michael Dewey http://www.aghmed.fsnet.co.uk -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@stat.math.ethz.ch 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.
Re: [R] Error when naming rows of dataset
Try 'row.names=NULL' on the read.table function. On 10/25/06, yongchuan [EMAIL PROTECTED] wrote: I'm pretty new with R, so the only error message I see is the below that I pasted. I'm attaching the first few rows of the file for reference. The layout looks screwy when I attach it here but 'Start' to 'closingCoupon' is the first row in the .txt file. Thx! Start StopPrepayDate modBalance closingCoupon 1.1 6 7 0 811.27698.35 1.2 7 8 0 811.27698.35 1.3 8 9 1 811.27698.35 2.1 4 5 0 2226.0825 8.7 2.2 5 6 0 2226.0825 8.7 2.3 6 7 0 2226.0825 8.7 2.4 7 8 0 2226.0825 8.7 2.5 8 9 0 2226.0825 8.7 2.6 9 10 0 2226.0825 8.7 2.7 10 11 0 2226.0825 8.7 2.8 11 12 0 2226.0825 8.7 2.9 12 13 0 2226.0825 8.7 2.1 13 14 0 2226.0825 8.7 From: Michael Dewey [EMAIL PROTECTED] Date: Wed 25/10/2006 6:38 PM SGT To: yongchuan [EMAIL PROTECTED], r-help@stat.math.ethz.ch Subject: Re: [R] Error when naming rows of dataset At 17:30 24/10/2006, yongchuan wrote: I get the following error when I try reading in a table. How are 1.1, 1.2, 1.3 duplicate row names? Thx. R gives you brief details of where it was when it fell over. Have you checked in latestWithNumber.txt' to see whether R is right? table - read.table('latestWithNumber.txt', header=T) Error in row.names-.data.frame(`*tmp*`, value = c(1.1, 1.2, 1.3 , : duplicate 'row.names' are not allowed Yongchuan Michael Dewey http://www.aghmed.fsnet.co.uk __ R-help@stat.math.ethz.ch 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. -- Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem you are trying to solve? [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Error when naming rows of dataset
I get the following error when I try reading in a table. How are 1.1, 1.2, 1.3 duplicate row names? Thx. table - read.table('latestWithNumber.txt', header=T) Error in row.names-.data.frame(`*tmp*`, value = c(1.1, 1.2, 1.3, : duplicate 'row.names' are not allowed Yongchuan __ R-help@stat.math.ethz.ch 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.