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=10000, grid=somgrid(5,4, "hexagonal"))

pdf(file=paste("/home/cdu/changbin/", fname, ".pdf", sep="") #output graphic file.

plot(final.som, main="Unsupervised SOM")

dev.off()

}

I have many different files, if I want output pdf file with the same name
as for each dataset I feed to the function somfunc.

HOw should I DO?

This seems to be a popular question this week. You should read more of r-help.

--

Changbin Du
DOE Joint Genome Institute
Bldg 400 Rm 457

David Winsemius, MD
West Hartford, CT

______________________________________________
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.

Reply via email to