Given the following code:
x <- 1
save(x, file = "x")
file.remove("x")
The file.remove()
command successfully removes the x file. However, it returns TRUE
to the R console. How do I keep it from doing that?
I've tried things like file.remove("x", silent = TRUE)
, but it seems that whatever I add to the function is interpreted as a file name, since the above returns cannot remove file 'TRUE', reason 'No such file or directory'
.
Try wrapping the call with invisible
x <- 1
save(x, file = "x")
invisible(file.remove("x"))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With