Fork me on GitHub

JHSPH

Overview:


Welcome to Introduction to R for Public Health Researchers!

This course is for students who have little to no familiarity with the R programming language and want to learn more about how to use R to import, wrangle, visualize, and analyze data.

The course will provide students with “hands-on” training for analyzing data with the R programming language for statistical computing, a popular open-source solution for data analysis and visualization.

Instructors:


TAs


Class:


Zoom:


closed captioning on zoom

reactions about pace

ask for help

Grading


  1. Attendance/Participation: 20% (Please let the instructors know if attendance will be difficult for you.)
  2. Homework: 3 x 15%
  3. Final “Project”: 35%

All assignments are due Wednesday, Jan 26, 2022 at 11:59pm EST.

Note: only people taking the course for credit must turn in the assignments. However, we will evaluate all submitted assignments in case others would like feedback on their work.

Submitting Assignments


Submit each assignment to the designated Drop Box on CoursePlus.

You should complete the following:

  1. Data Quest: Introduction to Programming in R
  2. Homework 2 Problem Set:
  3. Homework 3 Problem Set:
  4. Final Project (see below)

Final Projects


This project should entail:

You may use one of these public datasets, a different public dataset, or your own data for the project. If using your own dataset, be sure any sensitive information is protected.

Example projects can be found with the source code: Rmd, and the output html here.

See the guidelines/instructions for final projects.

Code of Conduct

We would like to create an open, safe, welcoming, diverse, inclusive, intellectually stimulating, and hopefully fun class experience.

We strive to be a space in which individual differences are respected, so that each individual can reach their fullest potential.

Guidelines

  • Demonstrating empathy and kindness toward other people
  • Giving and gracefully accepting constructive feedback
  • Avoiding making assumptions about others
  • Being respectful of differing opinions, viewpoints, and experiences
  • Take the time to consider how your speech and actions may influence others
  • Actively seek to acknowledge and respect the boundaries of other members
  • Demonstrating academic integrity
    • Students can work together, but assignments must show unique contributions from the student who turns in the assignment
    • Students can use online resources for help, but assignments must show unique contributions from the student who turns in the assignment - plagiarism is not allowed
    • If students are struggling, reach out to instructors or TAs as early as possible

This applies to emails, surveys, Slack, Zoom, office hours, meetings with other students, instructors, or TAs.

Please reach out to a TA or instructor if you witness or experience a violation of the class guidelines or other JHU codes of conduct.

The University has developed avenues for reporting and for seeking help including:

● JHU Sexual Assault Helpline, 410-516-7333 (confidential) ● Campus Safety and Security, 410-516-7777 ● University Sexual Assault Response and Prevention website ● Johns Hopkins Compliance Hotline, 844-SPEAK2US (844-733-2528) ● JHU Office of Institutional Equity 410-516-8075 (nonconfidential) ● Johns Hopkins Student Assistance Program (JHSAP), 443-287-7000 ● University Health Services - Mental Health (UHS-MS), 410-955-1892 ● The Faculty and Staff Assistance Program (FASAP), 443-997-7000

All the Requirements in this Course


Packages

We have an R package called jhur that will make sure all the packages are installed.

install.packages("remotes")
remotes::install_github("muschellij2/jhur")

Data

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.

Schedule


In recognition of Martin Luther King Jr. Day, there will be no class on Monday January 17th 2022. There is an assignment due before class to install software and we recommend completing HW 1 (uploading a screenshot showing that you finished the Dataquest module indicated below) before class, but all other assignments will be due January 26th. You are welcome to turn assignments in earlier if you wish.

Day Module Slides Code Resource Cheatsheets/Guides
Day 0 Homework 1 Dataquest
Day 1 Intro HTML, PDF R, Rmd Day 1 Cheatsheet
RStudio HTML, PDF R, Rmd Lab, Key, Key HTML
Reproduciblility Slides, HTML, PDF R, Rmd Good scientific coding practices
Day 2 Basic R HTML, PDF R, Rmd Lab, Key, Key HTML Day 2 Cheatsheet
Data IO HTML, PDF R, Rmd Lab, Key, Key HTML Debugging tips guide
Day 3 Subsetting Data in R HTML, PDF R, Rmd Lab, Key, Key HTML Day 3 Cheatsheet
Homework 2 Rmd, HTML, Key, Key HTML
Day 4 Data Summarization HTML, PDF R, Rmd Lab, Key, Key HTML Day 4 Cheatsheet
Data Classes HTML, PDF R, Rmd Lab, Key, Key HTML
Day 5 Data Cleaning HTML,PDF R,Rmd Lab, Key, Key HTML Day 5 Cheatsheet
Homework 3 Rmd, HTML, Key, Key HTML
Day 6 Manipulating Data in R HTML, PDF R, Rmd Lab, Key, Key HTML Day 6 Cheatsheet
Intro to Data Visualization HTML, PDF R, Rmd Lab, Key, Key HTML
Day 7 Data Visualization HTML, PDF R, Rmd Lab, Key, Key HTML Day 7 Cheatsheet
Factors HTML, PDF R, Rmd Lab, Key, Key HTML
Day 8 Statistics HTML, PDF R, Rmd Lab, Key, Key HTML Day 8 Cheatsheet
Project Guidelines HTML, Rmd Example RMD, Example HTML Instructions
Day 9 Functions HTML, PDF R, Rmd Lab, Key, Key HTML Day 9 Cheatsheet
Project Guidelines HTML, Rmd Example RMD, Example HTML Instructions

Additional Resources


Need help?

Want more?

Interested in Reproducibility?

Check out Candace’s courses:

R for Stata, SPSS, and SAS files

Online Videos of Lectures


From Winter Institute 2020

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
Data Cleaning https://youtu.be/G3V2YPaQN34
Data Manipulation https://youtu.be/43MPdw5bf4o
Statistics 1 https://www.youtube.com/watch?v=Jr4ljyzrr4U
Statistics 2 https://youtu.be/ub2BSbK9lMM

Find an Error!?


Feel free to submit typos/errors/etc via the github repository associated with the class: https://github.com/jhudsl/intro_to_r_class

This page was last updated on 2022-01-20.

Creative Commons License


This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.