
Explore synthetic data across nine sheets in a relational database setup. Learn to join sheets using primary and foreign keys, with left joins to combine reports, locations, and clinical information.
Download zip folder with data, R project file, and project folders.
Download and install RStudio desktop, a free integrated development environment for R, from Posit. Configure global options, enable soft wrap, and tailor a clean multi-pane layout for coding.
Zip folder with project folders and course datasets.
Configure the project folder structure and set the working directory in RStudio using session, then verify the path with get working directory to prepare for data loading.
Learn to install and load packages in R from CRAN or GitHub, create a vector of package names, and use a consolidated command to manage tidyverse packages for data analysis.
Learn to subset and rename columns in R using dplyr's select, set_names, and rename, then split a column with separate; pipe into glimpse to inspect results.
Wrangle data with dplyr and lubridate: mutate date variables, filter by admin year, group by admin quarter and county, count, sort, and ungroup for clean analysis.
Master data wrangling in R by mutating and saving new variables, counting by county, and filtering to the top five counties for admission and quarter visualizations.
Create a ggplot bar chart of counts by admission quarter, faceted by the top five counties, and annotate bars with counts using geom_text, while adjusting y scales.
Adjust facet scales and add axis labels to visualize county data in r. Apply labs and tidyquant themes for clear, publication-ready visuals of clients admitted by county and quarter.
Attached is the Jumpstart final code.
Load four tables from CSV, Excel, and Snowflake, perform left joins to create a single data frame, restructure columns, and begin exploratory data analysis with visuals and descriptive statistics.
Explore data types and data structures by loading packages, creating character vectors, converting to factors, and handling dates with lubridate's mdy to prepare tibbles.
Combine vectors into data frames and tables, forming a two-dimensional structure of columns and rows. Access with the dollar sign and square brackets, and manage unequal lengths with NA.
Learn to create a Snowflake database, load four tables from csv files, connect from RStudio via ODBC, and query data with SQL to create data frames.
Explore feature engineering with mutate, case_when and if_else in R, creating report counts, binning by quantile and ntile, and deriving boolean and categorical variables like foster care and incident category.
Explore an initial data overview using three packages, starting with Data Explorer, to glimpse, introduce, and gather, then visualize missingness with plot missing, and learn NAF handling.
Explore data using Data Explorer visualizations, combining select helpers with startswith and dplyr, to create bar, density, correlation, and box plots, and generate an EDA report.
Explore data insight with the skimmer package to quickly summarize data structure, missing values, and statistics, then examine bivariate relationships using the gallery package’s GG pairs with gender-based grouping.
Load excel data and join four sheets into cw_df. Filter rows with numeric comparisons, mean-based conditions, range filters, and string matching, including group by and case-sensitive checks.
Filter with multiple conditions using and, or, and not, and explore filter if and filter at, plus missing values handling across character and numeric variables.
Combine and transform data with pivot longer and pivot wider, create a difference score, and bind rows by aligning and renaming columns for consistent datasets.
learn to group by and summarize in R using dplyr to compute mean, min, max, and counts by program, handle missing values, and visualize missing data with Data Explorer.
Explore date and time handling in R using lubridate to parse, convert, and manipulate date-time stamps, time zones, and Unix timestamps for time-based analysis.
Handle diverse date formats with lubridate, convert to date types, and extract report month and year. Use floor_date and ceiling_date to get the first and last days of each month.
Demonstrates computing one-month lags and percent change to compare monthly trend changes, handle NAs, and visualize lagged differences with ggplot in R for data analysis.
Learn to modify character strings in R using str_to_lower, str_detect, and str_replace_all, including mutate steps and piping, and feature engineering to flag counties by region.
Explore how str_glue in R can append text around variables and using mutate to create an incident response column from incident type and medical attention, and lowercase text when needed.
Explore feature engineering fundamentals, including creating new variables with mutate, categorizing by quantiles, and using case when and ordinal factors, with time series and categorical data examples.
Learn to compute year-to-date and rolling averages in R by counting monthly reports, creating cumulative and percentage columns, and applying a three-month rolling mean.
Leverage Lubridate for time-based feature engineering in R, using select, filter, mutate, and group by to count reports by quarter and by date ranges.
At this point in the course, you can choose to continue with functional programming or skip to data visualizations and reporting. Functional programming can be more challenging and you may prefer to understand how to visualize data and create reports before diving into functions.
Apply functional programming in R to compute descriptive statistics: mean, sd, min, max, and IQR for numeric variables with anonymous functions, across variables, while handling missing values and excluding columns.
Learn to create your first function in R for data analysis, turning repetitive code into a descriptive stats function that accepts a data frame and an optional exclude columns argument.
Explore box plots to see median and quartiles, apply the 1.5 times IQR rule to identify outliers, and prepare a function to detect them from a 100-point data set.
Learn to add error handling to R functions, returning clear messages for missing or non-numeric inputs, then apply function across multiple numeric columns with mutate and across to expose outliers.
Create a small synthetic data set, compute outlier flags with the outliers function on report count, and visualize a ggplot box plot by gender with ID labels for outliers.
Explore running multiple t tests on variables in a data frame with R, using a run_t_tests function and purrr map to reveal gender differences in ace score and report counts.
Save numeric and grouping variables, pass them to the runtests function, and create a functions.R file in the zero_zero_scripts folder with append = true.
Explore choosing the right ggplot2 graphic for data types, including bar plots, density, scatter with regression lines, box and violin plots, and time series.
Learn to build a bar plot in R with ggplot, counting program admitted. Order bars by n in descending order with factor reorder, and add labs including title, subtitle, caption.
Learn to create a reusable bar plot function in R by encapsulating ggplot2 code in plot_bar, with customizable data, x and y, titles, captions, and axis labels.
Explore the relationship between ace score and incident counts using a scatter plot with geom_jitter for count data, then fit a linear model with geom_smooth to reveal a positive association.
Visualize the distribution of a numeric variable by gender using density plots in ggplot. Learn how to compare female and male report counts, adjust transparency, and explore optional facet wrapping.
Develop skills to create boxplots and violin plots in ggplot, compare report count by incident type and gender, and interpret medians, means, outliers, and distribution shapes.
Learn to build a line graph of 2020 monthly reports in R with ggplot, connect lines, add labels, and annotate a September dip, plus saving and sourcing plotting functions.
Install and load new libraries for reports, using the here package to navigate folders and tinytex to output pdfs, with steps to uncomment and run commands before the next section.
Learn how to create R Markdown reports that integrate text, code, graphs, and tables, export to HTML or PDF, and customize with YAML headers, code chunks, and themes.
Load and configure data analysis tools in R using tidyverse, readxl, and here; align project data, join tables, mutate variables, and prepare a customizable report with graphs.
Master placing text beside a table with CSS flex and div styles, using margins and padding to tailor left and right content in an HTML report.
Explore converting R markdown outputs to PDF, adjust YAML to pdf_document with a table of contents, and tune LaTeX styling and layout for tables and graphs.
Learn to customize graph layouts in R using the Patchwork package, installing it and arranging plots side by side or stacked with a row/column grid and labeled layouts.
Combine multiple graphs on a single page in R using the patchwork library and layout syntax, then prepare parameterized, automated reports in R markdown.
Toggle to the visual editor window and manually insert a table. Format headers, lists, pictures, code blocks, CSS, and equations, then knit to preview results.
This is the R course for beginners with no coding experience. It is based on the latest research in online learning theory and my personal experience with dozens of online courses. I created this course as the course I wish I would have had when I first started learning R.
We will code together and focus on the 20% of code responsible for 80% of the work. At the end of sections, you will have a 'Make It Stick' challenge to apply what you have just learned with a different dataset (based on principles in the book 'Make It Stick').
This course is different from other beginner courses in R in a couple significant ways:
Project-based learning with real-world scenarios: All lessons are based on common questions facing data practioners.
Content focus: The course outline and lectures are based on everyday workflows of data practioners rather than a bottom-up approach to R programming. Practically, this means we won't spend much time learning about R and core principles of programming; we will immediately start with how you will use it.
Current (& continually updated) code: I work in R everyday and make sure you are learning the best and most efficient ways to accomplish the most common and important tasks. For example, the rowwise function in the dplyr package enables you to perform calculations across columns by rows. A single line of code can now accomplish what was previously far more challenging.
Keeping it real: I keep the video rolling when I make an error. You can learn a lot from mistakes. R was my first programming language and I quit twice because of too many errors, too much time to learn it, and frustration with online courses that left out important steps or assumed knowledge that simply wasn't there. I try really hard to explain what we're doing while we're doing it and then giving you an opportunity to do it on your own with a different (but related) dataset.
In this course, you will learn to:
Load data from different sources (files, databases)
Structure data for analysis using the tidyverse packages
Quickly explore and visualize data trends
Conduct feature engineering for deeper analysis
Analyze survey data
Select the right visualization for your data
Create professional visualizations
Create and automate reports using RMarkdown