Re: [R] Error when naming rows of dataset

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Wed 25 Oct 2006 - 11:54:28 GMT

yongchuan <panyc@pacific.net.sg> 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 Stop PrepayDate modBalance closingCoupon
> 1.1 6 7 0 811.2769 8.35
> 1.2 7 8 0 811.2769 8.35
> 1.3 8 9 1 811.2769 8.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 <info@aghmed.fsnet.co.uk>
> > Date: Wed 25/10/2006 6:38 PM SGT
> > To: yongchuan <panyc@pacific.net.sg>, <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
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)                  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.
Received on Thu Oct 26 04:36:17 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 25 Oct 2006 - 19:30:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.