The purpose of this file is to get you up and running with RStudio. Please read the RStudio Master Plan first. R is an open source statistical software package that has become the dominant package of academia worldwide. R is the base package, supported by the worldwide user community. RStudio is a free commercial add-on to R which allows a more user-friendly interface. RStudio is the version we will use in Math 210: Introduction to Probability and Statistics, Math 318: Biostatistics. There are two ways to access RStudio: (i) load it onto your computer (free, takes about 150MB) and (ii) RStudio Cloud. Both versions will be the same R, with some minor variations due to web interface.
1. Which method should I use: internet or download onto my laptop?
a. Internet: For those who have reliable internet service and do not plan on using R or analyzing data in the future, or those who do not have their own computer, or those taking the course online (only recommended for these reasons).
b. Computer: For those who would rather have it on their computer, who will want to use it with no (or unreliable) internet access, or who will likely use it after this class (recommended choice).
2. Internet: RStudio Cloud: How do I get an RStudio cloud account?
a. Go to https://rstudio.cloud and sign up for an account.
b. Start a new project. Notice the limitations of the free account. If you come close to exceeding your limits, consider the download option, below.
3. Computer: How do I get RStudio on my computer?
Download and install R, followed by RStudio (2 downloads and installs) from https://posit.co/download/rstudio-desktop/. That's it. (Note:
If you need further guidance on navigating the www.r-project.org website, see below....
a. First, download R by going to www.r-project.org
i. From the “Getting Started” box in the middle of the page, click “Download R”, or equivalent.
ii. You’ll be directed to select a ‘CRAN mirror’ (software hosts around the world). They all have the same content, select the one closest to you for the fastest download speed.
iii. From the ‘Comprehensive R Archive’ page, select your operation system (Mac, Windows, Linux).
1. Windows – straightforward
2. Mac – Click the open apple in the upper left corner of your screen, then “About This Mac”, or equivalent. Make sure that you download a version of R that is compatible with your computer. Hint: If your computer is within several years old, then the latest version of R should be fine.
iv. Download the appropriate file and follow the directions to install. The default options are generally good for most students.
v. You now have R installed, which is the full functional version of the statistical software packages.
b. Don't forget to install RStudio from https://posit.co/download/rstudio-desktop/
c. Once everything is installed, you’ll have two options for running the software. The base installation of R has the following icon:
and RStudio has this icon:. We will use RStudio
exclusively in class – which is the same as the previous, but with some enhancements on the interface. Open the software and begin your statistical adventures….
4. What is the best way to start to learn R?
a. Everything necessary will be demonstrated in class. Bringing your laptop on demonstration days will help.
b. Use materials supplied on the R Materials website, https://sites.google.com/a/biola.edu/rtutorials/r-materials
c. Use the R script files posted on Canvas for both class demonstrations and homework solutions.
d. For a more thorough understanding, read the R Manual provided on Canvas, or consult the online book, An Introduction to R, http://cran.r-project.org/doc/manuals/R-intro.pdf
5. Why R?
a. R is free, while Excel, SPSS, StatCrunch, Minitab, etc. are not
b. R has the same interface for PC and Mac, (Excel has not for many years, although the Mac 2016 version was a big step closer to Windows....)
c. R is the academic standard statistical software
d. R, which is language-based, is more conducive to learning statistics than menu-based software such as SPSS or Minitab
e. R can produce publication quality graphics
6. Frequently Asked Questions (FAQs)
a. I've gotten RStudio loaded/accessed. How do I load the UCR data like you showed?
i. Download the data file from my website (Biostat use WS_CH1-172nd.RData; IntroStat use 210_LoadedData3.RData); save it in a location you can find.
ii. Using the web-version of RStudio, you will first need to upload the data from your desktop to the server. In RStudio, in the lower right panel, make sure the “File” tab is on top. Click “Upload” and select the data file you saved in step (i).
iii. In RStudio, in the upper right panel, make sure the “Workspace” tab is on top. Click the “Load” button. Select the data file you saved in step (i).
iv. The datasets (“data.frame”) should appear in the upper right panel. UCR should be in the list.
b. How do I load the script files like you showed?
i. Download the script file from my website, s.Introduction_to_R.R; save it in a location you can find.
ii. Using the web-version of RStudio, you will first need to upload the data from your desktop to the server. In RStudio, in the lower right panel, make sure the “File” tab is on top. Click “Upload” and select the .R file you saved in step (i).
iii. In RStudio, in the menu bar at top, select
File > Open File
Select the .R file you saved in step (i).
iv. The script file s.Introduction_to_R.R should appear in the upper left panel. To run the scripts, either highlight them and hit the “Run” button, or copy/paste into the “Console” (lower left panel).