Re: [R] column names with rbind loop

2011-08-30 Thread David Winsemius
erstand why you didn't use, ... header =TRUE, for both read operations. -- David. From: Weidong Gu [anopheles...@gmail.com] Sent: Tuesday, August 30, 2011 12:00 PM To: Vining, Kelly Cc: r-help@r-project.org Subject: Re: [R] column names with rbind

Re: [R] column names with rbind loop

2011-08-30 Thread Vining, Kelly
oject.org Subject: Re: [R] column names with rbind loop How about to add a conditional statement to get the header from 1st file for(i in all.files) { if (i==all.files[1]) new.data <- read.table(i,header=TRUE) else { new.data <- rbind(new.data, read.table(i))}} Weidong Gu On Tue, Aug 30,

Re: [R] column names with rbind loop

2011-08-30 Thread Weidong Gu
How about to add a conditional statement to get the header from 1st file for(i in all.files) { if (i==all.files[1]) new.data <- read.table(i,header=TRUE) else { new.data <- rbind(new.data, read.table(i))}} Weidong Gu On Tue, Aug 30, 2011 at 1:42 PM, Vining, Kelly wrote: > Hello R  users. > >

[R] column names with rbind loop

2011-08-30 Thread Vining, Kelly
Hello R users. This is a fairly basic question: I am concatenating data from sets of files in a directory using a loop. The column names in all files are exactly the same. My understanding is that rbind takes column names from the first file it reads. However, my output is showing that the co