我知道
pdf("myOut.pdf")
Run Code Online (Sandbox Code Playgroud)
将在R中打印成PDF.如果我愿意的话
制作一个循环,在PDF文件的新页面上打印后续图形(附加到末尾)?
创建一个循环,将后续图形打印到新的PDF文件(每个文件一个图形)?
Dir*_*tel 56
你看过帮助(pdf)了吗?
用法:
Run Code Online (Sandbox Code Playgroud)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)参数:
Run Code Online (Sandbox Code Playgroud)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.几个图进入同一个文件.
对于2),将onefile设置为FALSE并选择具有C整数格式的文件名,R将创建一组文件.
Mar*_*ark 36
不确定我理解.
附加到同一文件(每页一个图):
pdf("myOut.pdf")
for (i in 1:10){
plot(...)
}
dev.off()
Run Code Online (Sandbox Code Playgroud)
每个循环的新文件:
for (i in 1:10){
pdf(paste("myOut",i,".pdf",sep=""))
plot(...)
dev.off()
}
Run Code Online (Sandbox Code Playgroud)