unlink2 | R Documentation |
Delete files and directories
unlink2(x)
x |
|
This variant hardens file path handling, for better Windows compatibility.
integer(1)
.
0
for success, 1
for failure, invisibly.
Updated 2022-06-08.
tempdir <- tempdir2()
x <- file.path(tempdir, "file.txt")
y <- file.path(tempdir, "directory")
invisible(file.create(x))
invisible(dir.create(y))
out <- unlink2(c(x, y))
print(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.