Re: [R] jpeg, dev.off() inside function

2008-08-19 Thread Prof Brian Ripley
On Tue, 19 Aug 2008, Henrik Bengtsson wrote: In your function, split up your code in two lines as: pathname <- paste("test ", deparse(substitute(series)), i, ".jpg"); jpeg(filename=pathname, width=1200, height=800, pointsize=12, quality=400, bg="white"); The focus on what 'pathname' is/becomes

Re: [R] jpeg, dev.off() inside function

2008-08-19 Thread Henrik Bengtsson
In your function, split up your code in two lines as: pathname <- paste("test ", deparse(substitute(series)), i, ".jpg"); jpeg(filename=pathname, width=1200, height=800, pointsize=12, quality=400, bg="white"); The focus on what 'pathname' is/becomes when you put it inside your function. That wil

[R] jpeg, dev.off() inside function

2008-08-19 Thread marciarr
Dear all, I am trying to plot and save the plots. I have written a small function for that in which I use the jpeg and dev.off() commands. Strangely, when these commands are inside the function, they are not working anymore. For instance: dataframe<- data.frame (x=c(1:20),y=seq(0,9.5, length=20))