How to rename a file in R

Rename R file using R Programming command

What is it:

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.rename r file

In this R Programming tutorial/post we are discussing how to rename an R data using R command.

Why:

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 rename R file:





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

getwd()

Step 2: Check if the file you want to rename exists in the directory

file.exists(“myfileName.R“)

Step 3: If the file exists then use the below command to rename it.

file.rename(“myfileName.R” , “myfileRename.R“)

**replace the “myFileName” and “myfileRename” with your actual file names.

Note: Make sure you are using the commands after the ‘>’ symbol.


About Anson

I’m Anson, having versatile experience in Business Process Outsourcing, Finance & Accounting, Information Technology, Operational Excellence & Business Intelligence. I'm currently working in a MNC in Bangalore, India. Learning anything new has always been my passions and if its related to Business and Technology then, I love it. This website/blog is an outcome of my passion towards it and I have been blogging since 2012. Outside business and technology I’m a movie freak who spends hours together watching and learning Cinema.

One Comment

  1. Pingback: R command to rename an R file | asKeygeek | Sc...

Leave a Reply