[R] eliminating and relabeling the first column

From: Paul Adams <pma3622_at_yahoo.com>
Date: Sat, 07 Jun 2008 22:48:15 -0700 (PDT)


Hello everyone,
I have a data frame in which I am wanting to eliminate the row labels and then relabel the rows with g1-g2000.I have used the following code: dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\colon cancer1.txt",header=T,row.names=1) file.show(file="C:\\Documents and Settings\\Owner\\My Documents\\colon cancer1.txt") I thought that this would eliminate the row labels (first column) because of the header=T and row.names=1 argument. Then I tried to add the following to relabel the rows (first column) g1-g2000 dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\colon cancer1.txt",header=T,row.names=1) row.names(dat)<-paste("g",c(1:nrow(dat)),sep="") file.show(file="C:\\Documents and Settings\\Owner\\My Documents\\colon cancer1.txt") However I still get the same row labels that I have to begin with. Any help or explantation would be much appreciated. Paul

      
	[[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. Received on Sun 08 Jun 2008 - 05:57:38 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 08 Jun 2008 - 11:30:44 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.

list of date sections of archive