Skip to content
Prev 323951 / 398503 Next

Writing to a file

Hi,
Try this:
?lst1<-lapply(1:5,function(i) {pdf(paste0(i,".pdf"));? hist(rnorm(100),main=paste0("Histogram_",i));dev.off()}) #you can change the numbers
A.K.
?>between the pdf() and dev.off() line and it wouldnt add it to the file, even with a name as "foo.pdf". 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.pdf
Type: application/pdf
Size: 4635 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130521/e52733e3/attachment.pdf>