[R] Automation of c()

pallier pallier at lscp.ehess.fr
Sat Apr 10 10:19:56 CEST 2004


 > I have around 300 files with the x, y and z coordinates of a DEM that 
I would like to join in a
 > single data frame object. I know how to automate the import of the 
300 data frames.

 >
 > I do not know however how to automate the combination of the e.g. x 
vectors from all
 > imported data frames in a single vector avoiding the manual writing 
of all the imported
 > data frame names.

Why not concatenate all the data files under Bash?

cat *.dat >alldata.txt

You can then read 'alldata.txt' with a single read.table

Or, if you need to keep the file names in the data frame:

awk '{print FILENAME,$0}' *.dat >alldata.txt

Or am I missing something?

Christophe Pallier
www.pallier.org




More information about the R-help mailing list