MANAGING WORKSPACES USING SETWD AND GETWD FUNCTIONS IN R

October 31, 2016
By

(This article was first published on R – Greetz to Geeks, and kindly contributed to R-bloggers)

The R working environment is called a workspace. The workspaces are stored into a directory and is reloaded the next time you open R. We can choose which directory to be used to store our projects. The standard commands used for managing the workspaces are given below.
To find out your current working directory, the get working directory function can be used. There are no arguments for this function.
getwd()
To change your working directory, use the set working directory function along with the path to the new directory.
setwd(“path/to/the/directory”)
To move up a folder from the current directory, you can make use of,
setwd(“..”)
setnget
To check your command history, just use your Up and Down arrow keys in your keyboard or use,
history()
If you need the complete history of the commands used so far,
history(max.show=Inf) 
To list the objects in your current working directory,
ls()

To leave a comment for the author, please follow the link and comment on their blog: R – Greetz to Geeks.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)