
Kick off your journey in R programming for beginners with the course introduction, discover how R unlocks data analysis beyond Excel, and preview a mini project to showcase your skills.
Follow the video-based course with downloadable exercise and instructor files; download from the next module, unzip them, and adjust playback speed while viewing in high-definition, noting the review timing option.
Discover why R is an important free, open-source language for data analysis and statistics, born from S plus by Ross Ayaka and Robert Gentleman, and supported by a global community.
R is free and open source, easy to learn, and powerful for data cleaning, visualization, and machine learning with packages for missing values, partitions, classification, and random forests.
Prepare your workspace by downloading and installing R for Windows, then install the free open source RStudio desktop to start using R for visualizations and coding.
Learn to use RStudio to manage projects, create a new project, install and load packages, save scripts, and run code from the console.
Install R and RStudio step by step, following a guided walkthrough with links, operating system options, and troubleshooting tips to complete exercise one.
Set up a new R project in studio and perform basic console calculations. Assign results to variables using arrows, and view them in the global environment.
Explore data types in R, including numeric, integers, character, logical, complex, and raw, and learn how to convert between types to support diverse data structures.
Adopt consistent R coding style by using underscores for variable names, spacing around operators, and explicit returns. Follow proper curly bracket placement and avoid semicolons, per Hadley Wickham's tidy style.
Learn to write comments in R by focusing on the why, start with a hash, and use ctrl+shift+/ to reflow long notes under 80 characters.
Practice basics of R programming by calculating product, quotient, and sum in the console, then assign to a variable. Fix style issues and learn to comment lines with shortcuts.
Create atomic vectors, sequences with colon, and combined vectors in R, and learn how R coerces mixed data types to a single, most general type.
Learn to select components from a vector in R using one-based indexing, including positive and negative indexing, and logical indexing with true or false values and numeric comparisons.
Learn how to label vector components by naming elements like apples, bananas, and papayas to enable easy named indexing, using set names or names and is.vector to check the type.
Explore numeric vectors in R by performing sum, product, and division component-wise, learn vector recycling and repetition with repeat, and combine vectors with the combine function, noting order matters.
Explore base R functions for vectors, including mean, standard deviation, median, range, and length. Learn to sort vectors in ascending or descending order and reverse their sequence.
Compare two character vectors to identify common elements, check if all elements are the same, and perform numeric vector comparisons for less than and greater than, illustrated with bird counts.
Modify vector components in R by indexing to change the first element to eight, append elements with c(), and delete components using negative indexing or values not equal to eight.
Explore vectors in R by creating atomic and character vectors, naming a ratings vector, summing and averaging numeric vectors, replacing a value, and checking for common elements between vectors.
Learn to create and manipulate matrices in R with the matrix function, control row or column filling, bind with cbind and rbind, and explore diagonal, identity, and constant matrices.
Learn how to inspect and label matrices in R by naming rows and columns, checking dimensions with dim and attributes, and using set.seed for reproducible random scores.
Learn to select elements from matrices in R by using row and column indices, names, and logical conditions; extract rows, columns, single values, and submatrices while preserving dimensions.
Learn to perform basic matrix arithmetic in R, including addition, subtraction, division, and element wise multiplication of two matrices, and compute dot product, outer product, and the Kanako products.
Explore basic matrix operations in R, including inverses with solve, identity via dot product, transpose, containment with %in%, and brief mentions of eigenvalues, eigenvectors, and decompositions.
Change elements, add rows/columns with rbind and cbind, remove rows or columns using negative indexing, and replace NA/Inf with zero.
Craft and manipulate matrices in R by creating exercise matrix, adding a row, checking dimensions and contents, constructing an identity matrix, summing matrices, and extracting the value five.
Compare arrays and matrices in R, highlighting multidimensional arrays versus two-dimensional matrices. Learn to create one-dimensional, two-dimensional, and three-dimensional structures with the array function, and understand indexing and data storage.
Explore how arrays extend matrices by adding a third dimension, with names for rows, columns, and matrices, and use the array as a storage for matrix arithmetic.
Learn to apply functions to matrices and arrays in R, using apply with a margin to compute row or column results and sum the rows with built-in or user-defined functions.
Explore creating a multidimensional array in R that is not a matrix, define a three-dimensional vector with named dimensions, and compute the sum of each row using apply.
Explore how lists in R support mixed data types and nesting. Contrast them with vectors' single-type, contiguous storage, and learn to create lists with the list() function.
Learn to name lists and each element with a character vector using names, access items with the dollar sign, and call inner elements like hello in nested lists.
Explore how to select elements from an R list using single and double brackets, drill into nested items, access names and values, and apply integer or logical indexing.
Manipulate lists by adding elements with square brackets, overwriting and renaming items with a names vector, deleting elements by assigning null, and combining two lists.
Learn how to manipulate lists in R by converting to vectors with unlist, applying functions with lapply to compute means, and noting medians across lists.
Create a heterogeneous R list containing integers, logical, numeric, character, and vectors. Index with double brackets, concatenate, remove and add items, convert to a vector, then compute the mean.
Learn how to create factors in R, convert character vectors to factor levels, and store as integers for efficient handling of categorical variables and statistical modeling.
Set and explore factor levels in R by using levels and labels, extend factors with new levels, and view structure and output to understand coding and ordering.
Order factors in R by setting levels for chronological or alphabetical order, using ordered = TRUE, and functions like reorder and RSV, with examples from month names and visits.
Learn how to convert factors in R to numeric, character, and date types by using as.numeric, as.character, levels, and as.Date with a specified format, and understand common level-order pitfalls.
Create generic factor levels with the gl function and labels; use cut to classify a continuous variable into three groups, then view with table and apply pretty for nicer labels.
Practice creating and ordering factors, converting vectors to factors and numeric, and grouping iris petal length with pretty labels, testing factor status, and printing results as a table in R.
Explore loops in R programming by learning how to create and use for, while, and repeat loops, understand conditions, iterations, and breaking the loop with if statements.
Explore if-else statements in R, using conditional logic to print outcomes based on conditions, and compare characters or values to drive program flow.
Explore for loops in R to iterate over vectors, print values, and apply operations like square roots and squaring, with conditions and nested loops.
Discover how while loops run code while a condition is true, avoid infinite loops, and use prints, decrements, and breaks; explore nesting with for loops and attention to performance.
Explore repeat loops in R, learn how to break out with an if statement, and compare their end conditions to while loops with practical printing and decrementing examples.
Explore how for, while, and repeat loops work, their conditions, and when to use a loop for actions repeated three times or more.
Explore loops in R through a value check for 35, printing vector values with for loops, a while countdown, and a repeat loop for multiples of three to ninety nine.
Learn how to create user-defined functions in R, differentiate parameters and arguments, and build function bodies with return values to reuse code across analyses.
Learn how function arguments in R control inputs, including default values, positional versus named calling, and lazy evaluation, with examples using matrix and custom functions.
Explore nesting functions in R by placing a function inside another or inside a function's arguments, and understand recursion, termination, and minimal, focused function design.
Explore the difference between local and global variables in R, learn about environments and scoping, and see how double assignment with the two arrows can modify global values.
Learn to write R functions: build a vector input function, power with two parameters and a squared default, Fahrenheit-to-Celsius conversion, and nested function to compute mean and sd in Celsius.
In this R Programming for Beginners course, we start at the very beginning and introduce you to the R programming language. After that, we get you set up in R Studio and show you how to prepare the R Workspace.
We also show you how to import data into R Studio from various file formats before launching into the essential R components - Vectors, Matrices, Arrays, Lists, Factors, Loops, Functions, Dataframes and so much more.
This course includes downloadable challenges throughout to help you implement in real life what you are learning. At the end of the course, you pull everything you have learned together and complete a mini-project to help develop your skills.
This course is about hands-on learning, not just theory!
In this course you will learn:
What R is and how it is used in Data Science
Data types in R, coding style, and comments
How to use Vectors in R
How to use Matrices in R, including matric operations and modification
How to use Arrays in R
About using Lists in R including how to select list elements
All about Factors in R
How to use Loops in R and IF, ELSE statements
How to use Functions in R
How to use Data Frames including tidyverse and tibbles in R
To complete your first R programming assignment
This course includes:
6 hours of video tutorials
70+ individual video lectures
Exercise files to practice what you learned
An R project at the end of the course to implement what you have learned