[R] process all files ending in *.dat

Paul E Johnson pauljohn at ukans.edu
Mon Aug 13 18:24:21 CEST 2001


On Linux (RH7.1) with R installed from CRAN rpms:

I have many files with miscellaneous names *.dat. I would like to
successively open each one, run some functions on them, and then write
some output numbers to *.summary.  I have succeeded in doing this when I
type in each file name individually for the data input, but have not
found a way to search files in a directory and grab the *.dat.  If
somebody could tell me syntax or example of how to find the files, and
get the basename in order to create the new file name, I would be
grateful.
 
I tried
mydat<-system("ls *.dat")
but mydat does not catch the return.
Thanks for your many helps in the past...
-- 
Paul E. Johnson                       email: pauljohn at ukans.edu
Dept. of Political Science            http://lark.cc.ukans.edu/~pauljohn
University of Kansas                  Office: (785) 864-9086
Lawrence, Kansas 66045                FAX: (785) 864-5700
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list