Hello, If I have a four column data set (with thousands of rows), that doesn't have a header, how do I load in this text file, WITHOUT a row added for naming(i.e. numbering the rows, 1 2 3 4 5......). Also, if a row is added for naming, then will it be actually included in the data? That is, will that numbered row be included in analysis I run? (like PCA) Thanks! [[alternative HTML version deleted]]
At 7/15/2004 02:35 PM Thursday, you wrote:>Hello, > If I have a four column data set (with thousands of rows), that >doesn't have a header, how do I load in this text file, WITHOUT a row added >for naming(i.e. numbering the rows, 1 2 3 4 5......). >Also, if a row is added for naming, then will it be actually included in the >data? That is, will that numbered row be included in analysis I run? (like >PCA)I assume you really mean "a column added for naming the rows". My understanding is that data frames always have row names, but matrices do not. If memory is limiting (probably not), you could read the data into a matrix instead of a data frame. To answer your other question, row names are NOT included in any analysis. They are saved as character strings anyway, not numbers. MHP
The rownames of a data.frame are there for reference; they are not considered a column in your data set and will not be included in any analyses. The short answer as to whether you should try to remove them is no. To read in the file, use read.table(file, header=F), as you probably already discovered. Kevin -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Herman, David (NIH/NIMH) Sent: Thursday, July 15, 2004 11:35 AM To: 'r-help at stat.math.ethz.ch' Subject: [R] row naming Hello, If I have a four column data set (with thousands of rows), that doesn't have a header, how do I load in this text file, WITHOUT a row added for naming(i.e. numbering the rows, 1 2 3 4 5......). Also, if a row is added for naming, then will it be actually included in the data? That is, will that numbered row be included in analysis I run? (like PCA) Thanks! [[alternative HTML version deleted]] ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html