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

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

问题描述

我知道

  pdf(myOut.pdf)

会在R中打印成PDF格式。如果我想要


  1. 创建一个可在PDF文件的新页面上打印后续图形的循环(追加到最后)?

  2. 图表到新的PDF文件(每个文件一个图表)?


解决方案

你看看帮助(pdf)?

lockquote

用法:

  PDF(文件= ifelse(onefile Rplots.pdf, Rplot%03d.pdf),
的宽度,高度,onefile,家庭,标题,字体,文本,
纸张,编码,BG,FG,的pointsize,pagecentre,ColorModel中,
useDingbats,useKerning)

参数:

  file:给出文件名的字符串。与
'onefile = FALSE'一起使用时,给出一个C整数格式,例如
'Rplot%03d.pdf'(在这种情况下是默认值)。 (详见
'postscript')


对于1),您将onefile保留为默认值TRUE。对于2),您将onefile设置为FALSE并选择一个具有C整数格式的文件名,R将创建一组文件。

I know that

 pdf("myOut.pdf")

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

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

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

解决方案

Did you look at help(pdf) ?

Usage:

 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)

Arguments:

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.)

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

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天全站免登陆