Page 193 - Data Science class 11
P. 193

5.3.1 Setting/changing your Working directory

            You can set/change your working directory by using RStudio interface and by using R language command. Perform
            the following steps to set/change working directory:

            Step 1:     From RStudio, select Session Æ Set Working Directory Æ Choose Directory option from the menu bar.
                     The Choose Working Directory dialog box appears.


























            Step 2:     Select the desired directory and click on the Open button. In this case, we have selected Data Science
                     directory under Documents directory.




























            It is also possible to use the R language function setwd(), which stands for set working directory, to set the working
            directory. The path of the directory that you want to set as working directory is passed as a string parameter in the setwd()
            function. The directory path can either be a relative path or an absolute path. For Windows, the command might look like:
            setwd(“c:/Documents/my/working/directory”)
            You can also set the working directory from the Files tab.












                                                                                      Introduction to RStudio  191
   188   189   190   191   192   193   194   195   196   197   198