Time for action - first steps

To begin our analysis, we must first launch R and set our working directory:

  1. Launch R.
  2. The R console will be displayed.
  3. Set your R working directory using the setwd(dir) function. The following code is a hypothetical example. Your working directory should be a relevant location on your own computer.
    > #set the R working directory using setwd(dir)
    > setwd("/Users/johnmquick/rBeginnersGuide/")
    
  4. Verify that your working directory has been set to the proper location using the getwd() command:
    > #verify the location of your working directory
    > getwd()
    [1] "/Users/johnmquick/rBeginnersGuide/"
    

What just happened?

We prepared R to begin our analysis by launching the software and setting our working directory. At this point, you should be very comfortable completing these steps.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset