After some research I found out that the following works:
unlink(\"mydir\")
and you have to use the recursive
option in case you w
For those stumbling on this, I normally resort to using 'shell' command here to completely delete the folder.
Using 'system' will print a 127 error if the folder is non-empty.
The following is the simple nuclear option - deleting the folder in its entirety (no questions asked):
Loc <- "C:/file has spaces/hence the form below/"
shell( glue::glue("rmdir /s /q \"{Loc}\" ") )