0

我需要创建一个pdf文件,其中包含ggplot2在 A4 纸上排列的多个图表,并重复 20-30 次。

我将ggplot2图表导出到psPostScriptTrace文件中,并按照 中的说明尝试grImport,但它一直给我错误Unrecoverable error, exit code 1

我忽略了错误并尝试将生成的xml文件导入 R 对象,给我另一个错误:

属性构造错误
找不到开始标记文本行21
的结尾标记图片行3中的数据提前结束
错误:1:属性构造错误
2:找不到开始标记文本行21
的结尾3:数据提前结束标记图片第 3 行

这里有什么问题?

谢谢!

4

1 回答 1

0

If you have no time to deal with Sweave, you could also write a simple TeX document from R after generating the plots, which you could later compile to pdf.

E.g.:

    ggsave(p, file=paste('filename', id, '.pdf'))
    cat(paste('\\includegraphics{',
        paste('filename', id, '.pdf'), '}', sep=''),
        file='report.pdf')

Later, you could easily compile it to pdf with for example pdflatex.

于 2011-01-06T00:50:34.390 回答