标签: r save
如果我想要保存要保存在a <- 1下的R对象filename <- "a.rda",但只有当这样的a.rda文件不存在时,是否有更短的解决方案if(!filename %in% dir()) save(a, file = filename)?像save(a, file = filename, override = FALSE)这样的东西? (同样适用于write.table()或pdf()。)
a <- 1
filename <- "a.rda"
if(!filename %in% dir()) save(a, file = filename)
save(a, file = filename, override = FALSE)
write.table()
pdf()