R Programmierbefehl zum Löschen eines Verzeichnisses – R-Tutorials
Was ist R Programming:
R ist eine freie Software-Programmiersprache, die im Bereich statistischer Berechnungen und Grafiken verwendet wird. Dieses Programm wird hauptsächlich von Statistikern und Datenanalysten verwendet.Pin
In this R-Programmierung tutorial/post we are discussing the Command to delete a directory in R.
Warum:
Betriebssysteme verfügen zwar über eine einfachere Möglichkeit, dies zu tun. Wenn Sie jedoch in der Programmierumgebung arbeiten, ist es immer nützlich, die Befehle zum Erstellen oder Bearbeiten der Dateien verwenden zu können.
How to delete directory using R Programming command:
Schritt 1: Wenn Sie Ihr Active Directory nicht kennen, überprüfen Sie es mit dem folgenden Befehl.
getwd()
Schritt 2: Use the below r programming command to delete the directory.
unlink(“mytestDir“, recursive = TRUE)
**replace the “mytestDir” with your actual directory name.
R Programming uses the word “unlink” instead of “delete” which is more logical for deleting folder because R follows the UNIX way of deleting directory.
Notiz: Stellen Sie sicher, dass Sie die Befehle nach dem ' verwenden>'-Symbol.
Eine Antwort
Hi! Thanks a lot for making these helpful posts. I’m trying to learn R, and am having a quite a lot of trouble. Your posts are very useful. I am wondering what sort of response to expect from R if a file/directory is successfully deleted. I used the unlink command with the recursive=TRUE added, and I didn’t receive a warning as I had before, but I also didn’t receive any sort of confirmation that the directory had been deleted. I simply got another > command prompt. I tried deleting it again with the same command, and got the same result. I would think if I had successfully deleted it, I would have gotten an error message saying that the directory didn’t exist.