如何使用 R 删除 Windows 下的临时文件夹?
会话结束后,我想清理我的临时文件夹,例如
d <- tempfile()
dir.create(d)
setwd(d)
# now work and sweave and latex etc
如何删除 d
及其元素? file.remove
失败。
After a session I would like to clean up my temporary folders, like for instance
d <- tempfile()
dir.create(d)
setwd(d)
# now work and sweave and latex etc
How can I remove d
and its elements? file.remove
fails.
尝试
unlink("d", recursive=TRUE)
。这应该删除该文件夹及其内容。Try
unlink("d", recursive=TRUE)
. That should delete the folder and its contents.