Bos, Roger-2 wrote:
>
> I am trying to create plots within a for loop and output them to a pdf.
> Here is a working example using plot:
>
> gg <- data.frame(datadate=1:4, spread=5:8)
> pdf()
> for (i in 1:3) {
> plot(gg$datadate, gg$spread, main=i)
>
you have to print the object
gg <- data.frame(datadate=1:4, spread=5:8)
> pdf()
> for (i in 1:3) {
+ d <- qplot(gg$datadate, gg$spread, geom="line", main=i)
+ print(d)}
> dev.off()
On Tue, Mar 23, 2010 at 1:14 PM, Bos, Roger wrote:
> I am try
I am trying to create plots within a for loop and output them to a pdf.
Here is a working example using plot:
gg <- data.frame(datadate=1:4, spread=5:8)
pdf()
for (i in 1:3) {
plot(gg$datadate, gg$spread, main=i)
}
dev.off()
I am try
3 matches
Mail list logo