R Programming command to delete a directory – R Tutorials

R Programming
Оглавление

R Programming command to delete a directory – R Tutorials

Что R Programming:

R is a free software programming language used in the field of statistical computing and graphics. This program is mainly used by Statisticians and Data Analysts.R Programming CommandPin

In this R Programming tutorial/post we are discussing the Command to delete a directory in R.

Почему:

Though Operating systems will have simpler way of doing this however when you are working in the programming environment having the ability to use the commands for creating or manipulating the files is always useful.

How to delete directory using R Programming command:

Шаг 1: If you do not know your active directory check the same using the below command.

getwd()

Шаг 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.

Примечание: Make sure you are using the commands after the ‘>’ symbol.


Picture of Anson Antony
Энсон Энтони
Энсон — соавтор и основатель компании www.askeygeek.com. Изучение чего-то нового всегда было его страстью, а ASKEYGEEK.com — результат его страсти к технологиям и бизнесу. Он имеет десятилетний разносторонний опыт в области аутсорсинга бизнес-процессов, финансов и бухгалтерского учета, информационных технологий, операционного совершенствования и бизнес-аналитики. За время своего пребывания в должности он работал в таких организациях, как Genpact, Hewlett Packard, M*Modal и Capgemini, занимая различные должности и обязанности. Помимо бизнеса и технологий, он любитель кино, который часами вместе смотрит и изучает кино, а также кинорежиссер!

Один ответ

  1. 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.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Поздравляем!
Ты сделал это,
Не закрывайтесь!

Вставай 60 000 Кредиты на персонажей UberTTS бесплатно!!!

Это всплывающее окно не покажет вам решать снова!!!

УберТТС
Share to...