How to remove a directory in R? -


After some research, I came to know that the following works:

  Unlink ("mydir")  

)

and you must use the recursive option when you want to delete the recursive:

  unlink ("Mydir", recurring = true)  

However, I have seen that unlink ("mydir") alone, without recursive Option, not when the mydir subdirectories are included, then any one generates the product It does not remove the DIR, but no warning shows nothing:

  & gt; List.dirs () [1] "." "./r" & gt; Dir.create ("Test") & gt; Dir.create ("test / test2") & gt; List.dirs () [1] "." "./r" "./test" "./test/test2" & gt; Unlink ("Exam") ######### I hope there is a warning ######### & gt; List.dirs () [1] "." "./r" "./test" "./test/test2" & gt; Unlink ("test", recursive = TRUE) & gt; List.dirs () [1] "." "./r"  

Is there any way to get any "information", such as you will get in the Unix system?

  $ Rmdir test rmdir: failed to delete: «test»: directory is not empty  

I version 3.1.2 (2014-10-31 ). I tried to play with the option (warning = 1) etc. But no luck.

0 for success, 1 for failure, invisibly help ? Unlink :

Value

Not to be removed from a non-existent file is not a failure, nor is it unable to delete a directory if Recursive = FALSE However missing values ​​in X are considered to be failure.

In a case where a folder foo unlink without calls recursive = TRUE back 1 .

Note that the actual transaction is similar to rm -f , which means that unlinking will return a non-existent file 0.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -