そんなこと知ってる
pdf("myOut.pdf")
RでPDFに印刷されます。
PDFファイルの新しいページ(最後に追加)に後続のグラフを印刷するループを作成しますか?
後続のグラフを新しいPDFファイルに出力するループを作成しますか(ファイルごとに1つのグラフ)?
ヘルプ(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 のままにします。複数のプロットが同じファイルに入ります。
2) の場合、onefile を FALSE に設定し、C 整数形式のファイル名を選択すると、R が一連のファイルを作成します。
わかりません。
同じファイルに追加 (1 ページに 1 つのプロット):
pdf("myOut.pdf")
for (i in 1:10){
plot(...)
}
dev.off()
各ループの新しいファイル:
for (i in 1:10){
pdf(paste("myOut",i,".pdf",sep=""))
plot(...)
dev.off()
}
pdf(file = "Location_where_you_want_the_file/name_of_file.pdf", title="if you want any")
plot() # Or other graphics you want to have printed in your pdf
dev.off()
pdf で必要なだけ多くのものをプロットできます。プロットは、異なるページの pdf に追加されます。dev.off() はファイルへの接続を閉じ、pdf が作成され、次のようになります。
> dev.off()
null device 1