[R] Automating R for multiple data files

Adam Tee adam at ajtee.uklinux.net
Thu May 1 17:57:38 CEST 2003


I'm new to R and have looked at the mail archives and not
seen a solution to my problem.

I have a set of data files with filenames in the following form
haydn1stmvt.jtf.sim0.142292.et.dist, where the latter half
changes, after the jtf.

What I am trying to do is process the set of these files using
R's batch mode. using the following :


mdsdata <- read.table(file)
cm <- cmdscale(mdsdata)
x <- cm[,1]
y <- -cm[,2]

postscript("file.eps", height=5, width=5)
plot(x,y,type="n", main="classical MDS")

I want the variable file to contain the relevant file name with
having to input it manually for each file. Is there an easy solution to 
this ??


Adam Tee
PhD Student
University of Leeds

More information about the R-help mailing list