[R] Re move row.names column in dataframe

Bill.Venables at csiro.au Bill.Venables at csiro.au
Sun Jun 22 09:01:27 CEST 2008


- There is no column in the data frame called "row.names".  It only
looks that way when you use the viewer.

- All data frames must have row and column names.  This is not
negotiable.  Also, the row.names will not interfere with any merging
operation because they are not a column of the data frame: they are the
row names.


Bill Venables
CSIRO Laboratories
mailto:Bill.Venables at csiro.au
http://www.cmis.csiro.au/bill.venables/ 

-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of tonyxv
Sent: Sunday, 22 June 2008 11:15 AM
To: r-help at r-project.org
Subject: [R] Re move row.names column in dataframe



Hello,

aa<-c(1,1,2,2,3,3,4,4,5,5,6,6)
bb<-c(56,56,33,33,53,53,20,20,63,63,9,9) 
cc<-data.frame(aa,bb) 
uniquedf <- unique(cc)
View(uniquedf)


Why does the column "row.names" appear in the new dataframe and how do I
get
rid of it.

"uniquedf$row.names <- NULL" does not seem to work.

For what I'm doing this is a useless column and can cause confusion
and/or
problems for subsequent merging/filtering etc.


Thanks.
-- 
View this message in context:
http://www.nabble.com/Remove-row.names-column-in-dataframe-tp18050179p18
050179.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.



More information about the R-help mailing list