Delete files and directories
Arguments
- x
character
. Files or directories to be deleted. Unlink baseunlink
, these must exist on disk or the function will intentionally error.
Examples
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)
#> [1] 0