Hi everybody,

I would like to ask if it is possible using pdf function or some other to
print plots in cycle such that every new plot is on new page.

like this

pdf(file="D:/Plot.pdf",width = 9.25,height=9.25,
family="Helvetica",pointsize=8,bg="white")

for (i in 1:10){

x <- seq(1,40,1)
y <- 2*x+1+5*rnorm(length(x))

hist(y,freq = FALSE)
plot(density(y))
}

dev.off( )

but the problem is that I have a lot of other code in the cycle which I
don't want to be printed in PDF.

Thanks a lot for the help

	[[alternative HTML version deleted]]


