How to Change Values in a Vector in R
How to Summarize a Dataset in R
How to Distinguish Data Types in R

How to Install and Configure RStudio

RStudio is a relatively new and shiny editor for R. It’s easy to use, it has a decent Help page, it has very good support, and it incorporates R in a practical way. Of course, you’re free to work with any text editor you like.

How to install RStudio

Installing RStudio is easy. Just follow these steps:

  1. Go to RStudio Download.

  2. Click the Download RStudio Desktop button.

  3. Select the installation file for your system.

  4. Run the installation file.

RStudio will be installed on your system. It normally detects your latest installed R version automatically. If you didn’t do anything funky, you should be able to use R from within RStudio without extra configuration.

How to configure RStudio

You may want to use a different R version from the one RStudio detected. For example, you may want to use R in a 64-bit context. Or RStudio may not have recognized your installation of R. In that case, you can set which R version to use by choosing Tools→Options to open the Options pane.

image0.jpg

To change the R version, click the Change button. Then you can switch between the default 32-bit R installation or the 64-bit R installation (if installed), or you can choose a specific version of R. (RStudio lists all the versions it can find.)

If you click Browse, you can select the root directory for any R version you want to use. This folder normally looks something like …/R/R-n.n.n. If you select an R version that has both 32-bit and 64-bit builds, RStudio will ask you which build you want to use.

In the Options pane, you also can tweak the behavior of R in RStudio. If you click the General icon in the left column, you get all the default options for R in RStudio:

  • Initial working directory: You can set the default working directory R will use at startup.

  • Save workspace to .RData on exit: Your options are Ask, Never, or Always. By default, RStudio asks you whether you want to save the workspace when you quit.

  • Restore .RData into workspace at startup: Select this check box to let RStudio restore the workspace automatically at startup. RStudio will look for a saved workspace in the root folder or the default working directory.

  • Always save history (even when not saving .RData): Select this check box to have RStudio always save the history. If you don’t select this check box, RStudio doesn’t save the history when you exit the program.

  • Use single global history (rather than per-working directory): Select this check box to have RStudio always save the history in a single global file.

  • Remove duplicate entries in history: If you select this check box, RStudio removes duplicate entries from your history when the history is saved.

  • Comprehensive R Archive Network (CRAN) mirror: Click the Change button to set the CRAN mirror site that RStudio uses to install new packages.

These settings work for R only from within RStudio. If you use R with another editor or by itself, the settings in RStudio will have no effect.

  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
How to Create and Assign Named Vectors in R
How to Work with Lookup Tables in R
How to Know When to Care About Warnings in R
How to Use Arguments When You Transform a Script in R
How to Enter Data into the R Text Editor
Advertisement

Inside Dummies.com