[R] PDF Corrupted?

p_connolly at slingshot.co.nz p_connolly at slingshot.co.nz
Wed Oct 28 02:58:32 CET 2009


Quoting rkevinburton at charter.net:

> I am running R 2.9.2 and creating a PDF that I am trying to open with 
> Adobe Reader 9.2 but when I try to open it the reader responds with
>
> "There was an error opening this document. The file is damaged and 
> cannot be repaired.:
>
> I am using the R command(s):
>
> pdf(file="cat.pdf", title="Historical Sales By Category")
> for(j in 1:length(master))
> {
>     d <- as.Date(master[[j]]$Period[1], format="%m/%d/%Y")
>     fit <- ets(ts(master[[j]]$Quantity, start=c(1900 + 
> as.POSIXlt(d)$year, 1 + as.POSIXlt(d)$mon), frequency=12))
>     plot(fit, col.axis = "sky blue", col.lab = "thistle")
>     title(master[[j]]$Category,
>           cex.main = 2,   font.main= 4, col.main= "blue")
> }
>
> Any idea what I am doing wrong?

try dev.off() at the end.  Yous is an FAQ.




More information about the R-help mailing list