Fundamentals of R and Posit (R Studio)
This is the pre-course to the one day workshop on April 6, 2024. Limited seating is available for this course.
This one-day intensive course is designed to introduce participants to R and RStudio (Posit), equipping them with the fundamental skills required to start their journey in data analysis and programming. The course begins with an overview of R and RStudio’s environment, highlighting how these tools are used for data manipulation, analysis, and visualization in various fields. Attendees will learn how to import, clean, and manipulate datasets using R’s dplyr package, along with how to create data visualizations using R’s ggplot2 package. Throughout, this course focuses on the principals of data transparency and reproducibility. By the end of the day, participants will have a solid foundation in R and RStudio, enabling them to confidently apply their new skills to real-world data analysis projects. This course is ideal for beginners with no prior experience in R or those looking to refresh their skills.
Prior to class
Requirements – A Laptop computer running any of Linux, Mac or Windows OS.
- Install R following directions from here: https://cran.r-project.org/
- Install Rstudio (Posit) following directions from here: https://posit.co/downloads/
Date and Registration
- Date: Saturday, March 30, 2024
- Time: 8 a.m. to 5 p.m.
- Location: Talley Student Union, Rm 4280
Instructors
John S. House, Ph.D., M.Stat
Start | End | Program |
---|---|---|
8am | 8:30am | Arrival |
8:30am | 9:30am | R and Rstudio overview, navigation and setup |
9:30am | 10am | Getting data in and out of R |
10am | 10:15am | BREAK |
10:15am | 11am | Working with vectors |
11am | 12pm | Working with data frames |
12pm | 12:45pm | LUNCH |
12:45pm | 1:45pm | Data munging with dplyr |
1:45pm | 2:30pm | Merging data in R with dplyr |
2:30pm | 3pm | Data visualization I |
3pm | 3:15PM | BREAK |
3:15pm | 4:15pm | Data visualization II |
4:15pm | 5pm | Intro to functional programming |
Concepts
Rstudio IDE Overview
- Installing and loading packages
- Opening and closing scripts
- Help documentation access
- The working directory and relative paths
- Assignment operator and object browser
- Rstudio Script Types – this course will focus on R markdown
- .R vs .RMD and knitting to HTML output
Importing and exporting data
- Base R functions for delimited files
- data.table package and fread()
- Excel files from readxl package
Working with Vectors
- Vector Creation and Types of Vectors (character, numerical, logical) using c()
- Vector Operations (sum(), mean(), length(), min(), max())
- Logical Operations
- Indexing and Subsetting
Working with Data Frames
- Creation of data.frames()
- Inspection with head(), tail(), dim(), str(), nrow(), ncol()
- The $ notation
- Adding columns and rows with rbind() and cbind()
- Column calculations
Data Munging with dplyr()
- Filtering Rows and Columns with filter() and select()
- Creation of new variables with mutate()
- Summarizing data with summarise()
- Sorting and grouping operations with arrange() and group_by()
Merging datasets with dplyr()
Left, right, full, inner joins
Visualization
- Base R graphics
- Graphics in ggplot2
Functional Programming
- Parameters
- Default values
- Loops