OpenIntro Statistics Companion Notebooks
Installation and Access Guide
This guide provides instructions for how to access a collection of interactive notebooks that accompany the OpenIntro Statistics textbook. These notebooks deliver introductory statistics content along with instruction and support for computing in R. You will perform 3 or 4 steps depending on your operating system. The steps are listed below, but detailed instructions follow for both Windows and Mac OS systems.
- Install R: R is a computing language which has been optimized for use in statistics, data analytics, and data science.
- Install RStudio: RStudio is a convenient way to interface with the R language. Think of R as “Spanish” and RStudio as Microsoft Word – you can write R in RStudio, just like you can write Spanish text in Microsoft Word.
- Install the packages necessary to access the notes.
1. Installing R
Installing R is quite simple. Navigate to CRAN (the Comprehensive R Archive Network) and choose the link corresponding to your operating system. Follow the instructions below corresponding to your operating system below.
Windows:
Click the link titled Install R for the first time.
Click the link to download the installer for the most recent version of R. The link will be in a grey box containing something like Download R 4.4.2 for Windows.
- As of the time of writing, the current version is
R 4.4.2
.
- As of the time of writing, the current version is
Once the download completes, run the installer – keep all of the default options.
macOS:
- After clicking the link for the Mac OS operating system, look for the link corresponding to the most recent R version. It will be the top entry under the Latest Release heading. At the time of writing, the most recent version is R-4.4.2.pkg. There are two versions – one for Apple processors (M1, M2, etc.) and the other for older Intel processors – the version for Apple Silicon will be the appropriate version for nearly everyone. Click this link and follow the installation instructions. Keep all of the defaults set. If you encounter an error because you have an Intel processor, just click on the link for the Intel version and follow the installation instructions, keeping the default settings.
2. Installing RStudio
- To install RStudio, click this link.
- RStudio.com will automatically detect your operating system. Click the download link presented to you. It is a blue button underneath step “2.” – you’ve already done step “1.”.
- Once the download has finished, run the installer – keep all of the default options.
For Mac users, be sure to drag the RStudio orb icon across to your Applications folder when prompted.
3. Getting the Notes Packages
Search your computer for the RStudio application you just installed, and open it. When you first open RStudio you should be presented with a window that has three panes – the long pane on the left should be titled Console
. This is a place for you to run R code.
Click into the console next to the prompt (
>
) and type the following command:install.packages("devtools")
- If you are asked to install in a personal library, you can do so – this will make the package available only to you and no other user profiles on your computer.
You can hit the
Enter
orReturn
key on your keyboard to run the command. Red and black text will splash onto theConsole
while the required utilities are being installed. What for the install to finish – you’ll be presented with a message in the console that the install has finished and your prompt (>
) will return.After
devtools
has been installed, run the following commandremotes::install_github("agmath/AppliedStatsInteractive")
- After you hit
Enter
orReturn
and the command is run, you may be asked several times (three or four times) about updating existing packages. Choose 1 to update all of the recommended package (or choose 3 to update none, if you prefer) and hitEnter
orReturn
to proceed with the installation. - In between accepting or refusing the package updates, more black and red text will splash to the console. You’ll know that the installation has completed when you get a message in the console stating so and your prompt (
>
) has returned. This should take between 2 and 8 minutes, depending on the strength of your internet connection.
- After you hit
After the
AppliedStatsInteractive
package has finished downloading, run this final commandremotes::install_github("rundel/learnrhash")
Accessing the Notebooks
Now that you have R
, RStudio
, and the AppliedStatsInteractive
package installed you won’t need to work through those steps again.
Open
RStudio
– make sure you open RStudio and not just plain R – if you’ve only got a small window with a blinking cursor, that’s R – close it and reopen RStudio instead. The icon in your task bar should be a light blue orb with a white R in the center of it.You can now access the notes by clicking on the Tutorial tab in the top-right pane of RStudio. Locate the notes you would like to open and the click the
Start Tutorial ?
button.
If you get a message asking to install a missing dependency called learnrhash
, click cancel, go to the R console and run remotes::install_github("rundel/learnrhash")
, and try the Start Tutorial
button again after this install has completed.