Skip to content
Prev 320716 / 398500 Next

please help, iteration through a list of files and plot each one

There's probably a better way to do it, but here's one way:

require(stringr)
windows()
file_list <- list.files(pattern=".txt")
  
for (file in file_list)
{
        
  
   
  dataset <- read.table(file, header=TRUE, sep="\t")


  plot(dataset)
  savePlot(filename=str_replace(file,".txt",""),type="png")
   
}
On 4/1/2013 11:13 PM, David Lyon wrote: