After some research I found out that the following works:
unlink(\"mydir\")
and you have to use the recursive option in case you w
recursive
Here's a wrapper function for you if you really need to see an error msg:
.unlink <- function(x, recursive = FALSE, force = FALSE) { if (unlink(x, recursive, force) == 0) return(invisible(TRUE)) stop(sprintf("Failed to remove [%s]", x)) }