The sample analysis was shown only in class and is not viewable in this version of the notes.
Fall 2020
The sample analysis was shown only in class and is not viewable in this version of the notes.
Course overview
Introduction to R, RStudio and R Markdown
Programming basics
No programming knowledge presumed
Synchronous attendance is encouraged, but not required
Class will be very cumulative
Assignments, office hours, class notes, grading policies, useful references on R: http://www.andrew.cmu.edu/~achoulde/94842/
Canvas for gradebook and for turning in homework
Check the class website for everything else
This class will teach you to use R to:
Generate graphical and tabular data summaries
Efficiently manipulate data using tidyverse libraries
Perform statistical analyses (e.g., hypothesis testing, regression modeling)
Produce reproducible statistical reports using R Markdown
Free (open-source)
Programming language (not point-and-click)
Excellent graphics
Offers broadest range of statistical tools
Easy to generate reproducible reports
Easy to integrate with other tools
Basic interaction with R is through typing in the console
This is the terminal or command-line interface
You type in commands, R gives back answers (or errors)
Menus and other graphical interfaces are extras built on top of the console
We will use RStudio in this class
Download R: http://lib.stat.cmu.edu/R/CRAN
Then download RStudio: http://www.rstudio.com/
RStudio has 4 main windows (‘panes’):
RStudio has 4 main windows (aka ‘panes’):
Source pane: create a file that you can save and run later
Console pane: type or paste in commands to get output from R
Workspace/History pane: see a list of variables or previous commands
Files/Plots/Packages/Help pane: see plots, help pages, and other items in this window.
Use the Console pane to type or paste commands to get output from R
?function
into the Console
?mean
tab
key to auto-complete function and object namesUse the Source pane to create and edit R and Rmd files
?mean
), the documentation will appear in the Help tab