John Muschelli: jmusche1 at jhu.edu
Andrew Jaffe: andrew.jaffe at libd.org
Please go to https://courseplus.jhu.edu/, sign in, go to the Intro to R class, and then go to Drop Boxes to submit homework and projects.
This project should entail reading in a dataset of your choosing, doing some light data cleaning, performing some data summarization and visualization, and then doing some very light statistical analysis, like regression or chi-squared tests. Example projects can be found with the source code: Rmd, and the output Docx here.
Rmd and html output
We have an R
package called jhur
that will make sure all the packages are installed.
install.packages("remotes")
remotes::install_github("muschellij2/jhur")
Alternatively, all the packages used (in any way - homework, lecture, lab), are listed in this text file. If you would like to install all the packages from this file, please download that text file and run this R script.
All the functions used (in any way - homework, lecture, lab), are listed in this Google doc, which can start a kind of cheat sheet for you.
All the data used that are not specifically to be downloaded from the web are located in this zip file, but we will show you how to read data from the internet as well.
Module | Slides | Code | Resource | In Class Work |
---|---|---|---|---|
Day 0 | ||||
Homework 1 | Code Academy | |||
Day 1 | ||||
Intro | HTML, PDF | R, Rmd | ||
RStudio | HTML, PDF | R, Rmd | Lab, Key, Key HTML | |
Basic R | HTML, PDF | R, Rmd | Lab, Key, Key HTML | |
Data IO | HTML, PDF | R, Rmd | Lab, Key, Key HTML | |
Homework 2 | Rmd, HTML, Key, Key HTML | |||
Day 2 | ||||
Subsetting Data in R | HTML, PDF | R, Rmd | Lab, Key, Key HTML | |
Data Summarization | HTML, PDF | R, Rmd | Lab, Key, Key HTML | |
Day 3 | ||||
Data Classes | HTML, PDF | R, Rmd | Lab, Key, Key HTML | |
Data Classes summary | HTML, PDF | R, Rmd | ||
Data Cleaning | HTML, PDF | R, Rmd | Lab, Key, Key HTML | Live R file |
Homework 3 | Rmd, HTML, Key, Key HTML | |||
Day 4 | ||||
Manipulating Data in R | HTML, PDF | R, Rmd | Lab, Key, Key HTML | Live R file |
Data Visualization | HTML, PDF | R, Rmd | Lab, Key, Key HTML | Live R file |
Day 5 | ||||
Statistics | HTML, PDF | R, Rmd | Lab, Key, Key HTML | Live R file |
Functions | HTML, PDF | R, Rmd | ||
Knitr | HTML, PDF | R, Rmd |
ggplot2
figureCode Example | Script |
---|---|
Replacing with ifelse in dplyr | replace_if.R |
Relevant to hw2: Fixing problems in read_csv with col_types | read_csv_specifications.R |
Multiple Summarization (mean/sd) and summarize with quantile | mean_sd_number_of_non_missing.R |
Changing Factors in Stata file | stata_factors.R |
Tables and Figures in RMarkdown | tables_and_plots.Rmd |
Day | Link to Video |
---|---|
RStudio and Data Classes | https://www.youtube.com/watch?v=vyIsDnsq5jY |
Subsetting Data | https://youtu.be/mT8lSagYbjM |
Data Summarization Part 1 | https://www.youtube.com/watch?v=SZYpzt9zy0g |
Data Classes | https://www.youtube.com/watch?v=82zSA1N0mnA |
Statistics | https://www.youtube.com/watch?v=Jr4ljyzrr4U |
Day | Link to Video |
---|---|
Data Summarization | https://youtu.be/l-r4RBhNDDo |
Day | Link to Video |
---|---|
Day 1 | https://youtu.be/Xi-wsACc7p0 |
Day 2 | https://youtu.be/u1FQt9Hr8iw |
Day 3 | https://youtu.be/woc7AGJTzZw |
Day 4 | https://youtu.be/RZ7eVIMPIes |
Day 5 | https://youtu.be/e8cFV8wluC0 |
Day | Link to Video |
---|---|
Day 1: Part 1 | https://youtu.be/QdD6x3tDI5Y |
Day 1: Part 2 | https://youtu.be/GMBfu_bnKOI |
Day 2 | https://youtu.be/NQFAoxX-w74 |
Day 3: Part 1 | https://youtu.be/OEv1ZZXvToY |
Day 3: Part 2 | https://youtu.be/OEbgC3A5vKw |
Day 4: Part 1: Strings | https://youtu.be/D6QDXDlKaWs |
Day 4: Part 2: Strings | https://youtu.be/8pVPMZugn6E |
Day 5 |
Feel free to submit typos/errors/etc via the github repository associated with the class: https://github.com/muschellij2/intro_to_r
This page was last updated on 2020-11-17.
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.