[R] pdf filenames in while loop

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Wed Aug 20 13:34:07 CEST 2008


2008/8/20 Wesley Roberts <wroberts at csir.co.za>:
> Dear R users,

> pdf(file="as.character(paste(f.mat[a])).pdf")

Whoa! Why the quotes? And why the as.character? Just paste:

 pdf(file=paste(f.mat[a],".pdf",sep=""))

 should do it. It looks like you were trying to create a file called
"as.character(...etc".

Barry



More information about the R-help mailing list