Hi,

I have written a script that currently reads in a .txt file where I
specify the name e.g

mydata<-read.table("a_date.txt", header=TRUE)

The script eventually produces a plot, e.g:

pdf(file="myfilename.txt")
plot(etc)
dev.off

What I want to do is run this script on several input files in my
directory, without having to manually change the input file name each
time, and produce the output plot pdf with the input file name as the
output file name. It would also be handy if my plot title is also the
input file name.

I'm relatively new to R so i'm not sure how to approach this. I
presume it's some sort of loop function, but i've never implemented
one of these before - any advice would be greatly appreciated!

Thanks in advance!
Thomas
-- 
Thomas Barningham
Centre for Ocean and Atmospheric Sciences
School of Environmental Sciences
University of East Anglia
Norwich Research Park
Norwich
NR4 7TJ

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to