
我需要自动保存数据以避免以后命名错误,但我想在Rplots.pdf
.代码有一个文件,但不确定如何将其用于两个输出文件
data <- "sinus"
filename <- paste("Rplots.", data, ".pdf")
pdf(filename, height=10, width=10)
我需要它,因为我喜欢这样做Rscript code.r && evince Rplots.pdf
。
R:3.3.1
操作系统:Debian 8.5
答案1
为什么不使用 file.copy() 将文件复制到新文件名
来自 R 手册:
file.copy(from, to, overwrite = recursive, recursive = FALSE,
copy.mode = TRUE, copy.date = FALSE)