Delete files and directories
Examples
tempdir <- tempdir2()
#> Error in vapply(X = X, FUN = FUN, FUN.VALUE = logical(1L), ..., USE.NAMES = useNames): formal argument "USE.NAMES" matched by multiple actual arguments
x <- file.path(tempdir, "file.txt")
#> Error in file.path(tempdir, "file.txt"): cannot coerce type 'closure' to vector of type 'character'
y <- file.path(tempdir, "directory")
#> Error in file.path(tempdir, "directory"): cannot coerce type 'closure' to vector of type 'character'
invisible(file.create(x))
#> Error: object 'x' not found
invisible(dir.create(y))
#> Error: object 'y' not found
out <- unlink2(c(x, y))
#> Error: object 'x' not found
print(out)
#> Error: object 'out' not found