Introduction to R Programming

R is one of the best programming languages that are specifically designed for statistics and graphics. Programming in R is a fast and effective way to perform advanced data analyses and manipulations. In this course you will learn how to use R and utilize the many data analysis techniques, methods, and functions it has to offer to the professional data scientist.

Sign up to
preview the course
for FREE!

Create a free account and start learning data science today.

create free account
Our graduates work at exciting places:
walmart
tesla
paypal
citibank
booking.com

Section 1

Introduction & Getting Started

In this introductory part of the course, we will go for a walk in the R environment. First, we are going to install R and RStudio together. Then, we’ll dive straight into RStudio and learn about its interface, and how to make use of the main windows and tabs there. We will also talk about setting your working directory and getting additional help.

FREE Intro
FREE Downloading and installing R & RStudio
FREE Quick guide to the RStudio user interface
FREE Changing the appearance in RStudio
FREE Installing packages and using the library

Section 2

The building blocks of R

In this section you will learn about objects and coercion rules in R, functions in R, how to use R’s console. Not only that, by the end of the section you will have built your first very own function; it will be able to draw cards from a deck, so you can play your favourite board game even if you don’t have the physical cards in front of you.

FREE Creating an object in R
FREE Data types in R - Integers and doubles
FREE Data types in R - Characters and logicals
FREE Coercion rules in R
FREE Functions in R
FREE Functions and arguments
FREE Building a function in R
FREE Using the script vs. using the console

Section 3

Vectors and vector operations

Now that we have covered the basics, in this section we are about to drill deeper into R’s most widely used object type – the vector. You will learn how to create vectors and how to perform vector arithmetic operations. You will also see how to index and access elements from a vector, and how vectors recycle. Then, you will see how to change the dimensions of a vector and create a two-dimensional object from it. That will be our nice little segue into matrices.

Premium course icon Intro
Premium course icon Introduction to vectors
Premium course icon Vector recycling
Premium course icon Naming a vector
Premium course icon Getting help with R
Premium course icon Slicing and indexing a vector
Premium course icon Changing the dimensions of an object in R

Section 4

Matrices

In this section, you will learn how to create and rename matrices, and how to index and slice matrices. All of this will lay a super solid foundation for the big star of data analysis: the data frame. Not only that, but we will also talk about factors, which is related to the statistics part of the course. Finally, we will cover lists: R’s way of storing hierarchical data.

Premium course icon Creating a matrix
Premium course icon Faster code: creating a matrix in a single line of code
Premium course icon Do matrices recycle?
Premium course icon Indexing an element from a matrix
Premium course icon Slicing a matrix
Premium course icon Matrix arithmetic
Premium course icon Matrix operations
Premium course icon Categorical data
Show all lessons
Premium course icon Creating a factor in R
Premium course icon Lists in R
Show fewer lessons

Section 5

Fundamentals Of Programming With R

In this section of the course, we will go through some of the fundamental tools you need to learn when programming with R (and many other programming languages). We will cover relational operators, logical operators, vectors, IF, ELSE, and different types of loops (for, while, and repeat) in R. Some of these topics will have already been introduced to you in our Python training, but here you will have the chance to reinforce what you have learned and see things with R in mind.

Premium course icon Relational Operators in R
Premium course icon Logical Operators in R
Premium course icon Logical Operators and Vectors
Premium course icon If, Else, Else-If Statements
Premium course icon If, Else, Else-If Keep-In-Minds
Premium course icon For Loops in R
Premium course icon While Loops in R
Premium course icon Repeat Loops in R
Show all lessons
Premium course icon Building a Function in R 2.0
Premium course icon Scoping in R | Building a Function in R 2.0 (Ctnd)
Show fewer lessons

Section 6

Data frames

In this section, we will focus our attention on how to create and import data frames into R. How to quickly get a sense of your data frame by using the str() function, summary(), col-and row-names, and so on. We’ll learn about accessing individual elements of your data frame for further use. And about extending a data frame with either new observations or variables (or row and columns). Furthermore, we will talk about dealing with missing data because in real life that happens more often than we’d like. And we’ll discuss exporting data frames once we’re happy with their general state and ready to share them with the world.

Premium course icon Creating a data frame
Premium course icon The Tidyverse package
Premium course icon Data import in R
Premium course icon Importing a CSV in R
Premium course icon Data export in R
Premium course icon Getting a sense of your data frame
Premium course icon Indexing and slicing a data frame in R
Premium course icon Extending a data frame in R
Show all lessons
Premium course icon Dealing with missing data
Show fewer lessons

Section 7

Manipulating data

Here, we will be talking about data transformation with the dplyr package. More specifically, how to filter(), arrange(), mutate(), and transmute() your data; as well as how to sample() fractions and fixed number of elements from it. You will also learn what tidy data is, why it is extremely important for the efficiency of your work to tidy your data sets in the most meaningful way, and how to achieve this by using the tidyr package. You will be tidying several messy real-life data sets, and... you will learn how to combine multiple operations in an intuitive way by using the pipe operator.

Premium course icon Intro
Premium course icon Data transformation with R - the Dplyr package - Part I
Premium course icon Data transformation with R - the Dplyr package - Part II
Premium course icon Sampling data with the Dplyr package
Premium course icon Using the pipe operator
Premium course icon Tidying your data - gather() and separate()
Premium course icon Tidying your data - unite() and spread()

Section 8

Visualizing data

Plotting and graphing data is the most elegant way to understand your data and present your findings to others. In this section we are going to learn about the grammar of graphics and the seven layers that comprise a visualization. Then, we will jump straight into creating graphs and plots, with the ggplot2 package. Starting with the histogram, we will continue on to the bar chart, then onto the box and whiskers plot, and finally, the scatterplot. You will notice that with each new type of plot you will also be learning about a new layer or two, getting familiarized with ggplot2 and its inner workings in an incremental way.

Premium course icon Intro
Premium course icon Intro to data visualization
Premium course icon Intro to ggplot2
Premium course icon Variables: revisited
Premium course icon Building a histogram with ggplot2
Premium course icon Building a bar chart with ggplot2
Premium course icon Building a box and whiskers plot with ggplot2
Premium course icon Building a scatterplot with ggplot2

Section 9

Exploratory data analysis

In this part of the course, we start applying R for statistical analysis. We are ready to discuss several exploratory data analysis topics: population vs. sample; mean, median, and mode; skewness; variance, standard deviation, and the coefficient of variability, and covariance and correlation.

Premium course icon Population vs. sample
Premium course icon Mean, median, mode
Premium course icon Skewness
Premium course icon Variance, standard deviation, and coefficient of variability
Premium course icon Covariance and correlation

Section 10

Hypothesis Testing

At this point, you are already familiar with hypothesis testing. We covered it in one of our earlier modules – Statistics. What we will do here is a natural continuation – you will learn how to carry out hypothesis testing in R.

Premium course icon Distributions
Premium course icon Standard Error and Confidence Intervals
Premium course icon Hypothesis Testing
Premium course icon Type I and Type II Errors
Premium course icon Test for the Mean. Population Variance Known
Premium course icon The P Value
Premium course icon Test for the Mean. Population Variance Unknown
Premium course icon Comparing Two Means. Dependent Samples
Show all lessons
Premium course icon Comparing Two Means. Independent Samples
Show fewer lessons

Section 11

Linear Regression Analysis

Regression analysis is another topic we covered earlier in our program. As with hypothesis testing, this is a great opportunity to apply the theory you have learned previously in R.

Premium course icon The Linear Regression Model
Premium course icon Correlation vs. Regression
Premium course icon Geometrical Representation
Premium course icon Doing the Regression in R
Premium course icon How to Interpret the Regression Table
Premium course icon Decomposition of Variability
Premium course icon R-Squared
MODULE 2

Programming for Data Science

This course is part of Module 2 of the 365 Data Science Program. The complete training consists of four modules, each building up on your knowledge from the previous one. In contrast to the introductory nature of Module 1, Module 2 is designed to tackle all aspects of programming for data science. You will learn how to work with relational databases and SQL, as well as how to code in Python and R. By the end of this Module you will have a versatile programming skillset.

See All Modules

Trust the other 276,000 students

Ready to start?
Sign up today for FREE!

Whether you want to scale your career or transition into a new field, data science is the number one skillset employers look for. Grow your analytics expertise and get hired as a data scientist!