On 02/19/2010 10:32 PM, KennyL wrote:
Hi All,
I have a slight issue getting R to plot a series of tables automatically.
Essentially I have a series of tables that I wish to plot. They are named
on_2, on_3 etc. based on the file name when they were read in. I have
filelist<- list.files() to give me list of the table names. I wish to plot
each table, so I was thinking along some kind of for loop as below:
for (i in 1:Number_Files) {
plot(filelist[1])
}
With a few other bits a pieces, however obviously this tries to plot the
character string in filelist, any ideas on how to get R to read the
identically named table and plot that?
Hi Kenny,
It's a bit hard to tell without seeing the data, but I think you may
have the table in text form in the file, so you probably want something
like:
for(i in 1:Number_files) {
tabledata<-read.table(filelist[i])
plot(tabledata,...)
}
But the reading in will depend upon what format the data are in the files.
Jim
______________________________________________
R-help@r-project.org mailing list
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.