如何将 R 图形打印到 PDF 的多页和多个 PDF? [英] How to print R graphics to multiple pages of a PDF and multiple PDFs?

查看:32
本文介绍了如何将 R 图形打印到 PDF 的多页和多个 PDF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道

 pdf("myOut.pdf")

将在 R 中打印为 PDF.如果我想怎么办

will print to a PDF in R. What if I want to

  1. 制作一个循环,在 PDF 文件的新页面上打印后续图形(附加到末尾)?

  1. Make a loop that prints subsequent graphs on new pages of a PDF file (appending to the end)?

制作一个循环,将后续图形打印到新的 PDF 文件(每个文件一个图形)?

Make a loop that prints subsequent graphs to new PDF files (one graph per file)?

推荐答案

你有没有看帮助(pdf)?

Did you look at help(pdf) ?

用法:

 pdf(file = ifelse(onefile, "Rplots.pdf", "Rplot%03d.pdf"),
     width, height, onefile, family, title, fonts, version,
     paper, encoding, bg, fg, pointsize, pagecentre, colormodel,
     useDingbats, useKerning)

参数:

file: a character string giving the name of the file. For use with
      'onefile=FALSE' give a C integer format such as
      '"Rplot%03d.pdf"' (the default in that case). (See
      'postscript' for further details.)

对于 1),您将 onefile 保留为默认值 TRUE.多个图进入同一个文件.

For 1), you keep onefile at the default value of TRUE. Several plots go into the same file.

对于 2),您将 onefile 设置为 FALSE 并选择具有 C 整数格式的文件名,R 将创建一组文件.

For 2), you set onefile to FALSE and choose a filename with the C integer format and R will create a set of files.

这篇关于如何将 R 图形打印到 PDF 的多页和多个 PDF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆