Re: [R] help output figures in R

2010-04-06 Thread Changbin Du
Thanks so much! On Tue, Apr 6, 2010 at 5:19 PM, Dennis Murphy wrote: > If you have a bunch of files in the same directory, look into list.files() > and consider > using lapply or some type of loop to process the files. There are examples > from > past questions in the archives. Use package sos o

Re: [R] help output figures in R

2010-04-06 Thread David Winsemius
On Apr 6, 2010, at 6:00 PM, Changbin Du wrote: Perhaps: somfunc<- function (file) { fname <- deparse(substitute(file)) aa_som<-scale(file) final.som<-som(data=aa_som, rlen=1, grid=somgrid(5,4, "hexagonal")) pdf(file=paste("/home/cdu/changbin/", fname, ".pdf", sep="") #output g

[R] help output figures in R

2010-04-06 Thread Changbin Du
somfunc<- function (file) { aa_som<-scale(file) final.som<-som(data=aa_som, rlen=1, grid=somgrid(5,4, "hexagonal")) pdf(file="/home/cdu/changbin/file.pdf") #output graphic file. plot(final.som, main="Unsupervised SOM") dev.off() } I have many different files, if I want output pdf file