[R] delete excel id automatically generated

Andrew Robinson A.Robinson at ms.unimelb.edu.au
Wed May 4 01:20:07 CEST 2011


Try the function

rownames()

Andrew

On Tue, May 03, 2011 at 03:29:37AM -0700, agent dunham wrote:
> Dear community, 
> 
> I uploaded an excel with read.xls. My xls file actually have a column which
> is an id, ("plot" is the id) : 
> 
> plot height area
> 34    7.6     5.4
> 85    3.2     4.1
> 89    5.4     8.4
> 121   6.7    6.2
> ...
> 1325  2.1    1.5
> 
> However R uses another id, this way: 
> 
> r id   plot height  area
>  1      34    7.6     5.4
>  2      85    3.2     4.1
>  3      89    5.4     8.4
>  4     121    6.7    6.2
> ...
> 314  1325   2.1    1.5
> 
> I'd like that R used "plot" id because I delete some rows while studying
> regression, and R seems to be using the first id 1,2,3,4,...,314. Sometimes
> it's a mess to understand what R means in the plots when, for instance,
> states that data 200 is influential
> 
> Thanks in advance, user at host.com
> 
> 
> 
> 
> 
> --
> View this message in context: http://r.789695.n4.nabble.com/delete-excel-id-automatically-generated-tp3492147p3492147.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> 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.

-- 
Andrew Robinson  
Program Manager, ACERA 
Department of Mathematics and Statistics            Tel: +61-3-8344-6410
University of Melbourne, VIC 3010 Australia               (prefer email)
http://www.ms.unimelb.edu.au/~andrewpr              Fax: +61-3-8344-4599
http://www.acera.unimelb.edu.au/

Forest Analytics with R (Springer, 2011) 
http://www.ms.unimelb.edu.au/FAwR/
Introduction to Scientific Programming and Simulation using R (CRC, 2009): 
http://www.ms.unimelb.edu.au/spuRs/



More information about the R-help mailing list