Setting up R and RStudio

Milica Cudina

2020-08-29

About R

Download and install R

  • Go to https://cloud.r-project.org/
  • Download the version of R for your operating system: Windows, Mac, or Linux
  • The installation file will then get downloaded: .pkg on a Mac, or .exe on Windows, people with Linux know what they’re doing
  • Follow the instructions for installation
  • There is no need to run R (you’ll know why in a jiffy)

About RStudio

Download and install RStudio

If you run RStudio, you should see this

Two adjustments

  • Open the options window: Cmd+, (this means press Command and comma simultaneously) on a Mac or go to Tools and then all the way down to Global Options
  • Uncheck “Restore .RData into workspace on startup”
  • Set “Save workspace to .RData on exit” to “Never”

Additional adjustments?

  • If you want to export .pdf files for your assignment submissions, you will need to install some R packages
  • To do this, you need to run up to three lines in your console (the part on the left you see when you first open RStudio)
  • Do not do this now; do it when you have a few minutes to wait for the installation to finish

Additional adjustments (cont’d)?

  • The first line is:
    install.packages( “tidyverse”)
  • Then, remember if you have LaTeX already installed on your computer
  • If you do, you’re done
  • If you don’t, then run:
    install.packages(“tinytex”)
  • Then, you run:
    tinytex::install_tinytex()

HELP!

  • Google is your best friend!
  • Within the console you can type:
    help(“command”)
    or
    ?command

Now we play …