mql4beginner mql4beginner - 8 days ago 6
R Question

Why using unlink() won't delete the folder specified?

I've created a folder using

dir.create
function but when I tried to delete it using
unlink
function I didn't have success.How can I overcome this issue?
Here is my toy code:

NewFolder<-dir.create("C://TestFolder")
unlink(NewFolder, recursive = T)

Answer

Because your NewFolder doesn't have any path information (it returns TRUE).

NewFolder <- "C:/TestFolder"
dir.create(NewFolder)
unlink(NewFolder, recursive = T)
Comments