To use RStudio, you first have to install R. DO NOT install RStudio first. R has to be installed first, followed by RStudio.
To install R, go to the R Web site. Under “Getting Started:”, click download R. Choose a CRAN (Comprehensive R Archive Network) mirror site that is closest to you. This should bring you to the R download page, the relevant part of which will look something like this:
Under “Download and Install R,” download and run the installer (“Precompiled binary distribution”) for your particular computer platform. Follow the installation instructions and you should be off and running. Extensive gory details can be found at R Installation and Administration.
After installing R, there should be an R icon somewhere on your computer system, or perhaps an entry in an Applications folder or start menu. When you run R, you will be brought to the R console, which looks like this on an iMac:
After briefly studying the R console, terminate R and forget about it, because we will be using R from inside of RStudio. We will not dwell on the details of using R; for that, please see Introduction to R. We will focus instead on RStudio, which is what you need to install next. You must have R installed before you can use RStudio, but once RStudio is installed you do not need to have R running, as RStudio contains its own instance of R.
To install RStudio, go to the RStudio Desktop download site, and download and run the installer for your particular computer platform. After installation, run RStudio, and you should see something like this:
(Click to enlarge.)
The above screenshot is from an iMac, but Windows and Linux users should find it comparable to RStudio running on their systems.
For PDF output in RStudio, you also need to install a version of the TeX typesetting system. Specifically, you need to install either MiKTeX on Windows, MacTeX 2013+ on OS X/macOS (best to download with Safari, and use the full version, not the smaller BasicTeX), or TeX Live 2013+ on Linux).