Free course
Introduction to R
Master the basics of data analysis by manipulating common data structures such as vectors, matrices, and data frames.
Start Free Course4 Hours62 Exercises2,302,405 Learners6200 XPData Analyst TrackData Scientist TrackR Programming Track
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.Loved by learners at thousands of companies
Course Description
In this introduction to R course, you'll master the basics of this widely used open source language—including vectors, factors, lists, and data frames. With the coding skills you'll gain in this course, you'll be ready to undertake your own data analysis in R. There are millions of R users worldwide, cementing it as a leading programming language in statistics and data science. More and more organizations are using R, so begin your coding journey in one of DataCamp's most popular courses today!
- 1
Intro to basics
FreeTake your first steps with R. In this chapter, you will learn how to use the console as a calculator and how to assign variables. You will also get to know the basic data types in R. Let's get started.
- 2
Vectors
FreeWe take you on a trip to Vegas, where you will learn how to analyze your gambling results using vectors in R. After completing this chapter, you will be able to create vectors in R, name them, select elements from them, and compare different vectors.
Create a vector100 xpCreate a vector (2)100 xpCreate a vector (3)100 xpNaming a vector100 xpNaming a vector (2)100 xpCalculating total winnings100 xpCalculating total winnings (2)100 xpCalculating total winnings (3)100 xpComparing total winnings100 xpVector selection: the good times100 xpVector selection: the good times (2)100 xpVector selection: the good times (3)100 xpVector selection: the good times (4)100 xpSelection by comparison - Step 1100 xpSelection by comparison - Step 2100 xpAdvanced selection100 xp - 3
Matrices
FreeIn this chapter, you will learn how to work with matrices in R. By the end of the chapter, you will be able to create matrices and understand how to do basic computations with them. You will analyze the box office numbers of the Star Wars movies and learn how to use matrices in R. May the force be with you!
What's a matrix?100 xpAnalyze matrices, you shall100 xpNaming a matrix100 xpCalculating the worldwide box office100 xpAdding a column for the Worldwide box office100 xpAdding a row100 xpThe total box office revenue for the entire saga100 xpSelection of matrix elements100 xpA little arithmetic with matrices100 xpA little arithmetic with matrices (2)100 xp - 4
Factors
FreeData often falls into a limited number of categories. For example, human hair color can be categorized as black, brown, blond, red, grey, or white—and perhaps a few more options for people who color their hair. In R, categorical data is stored in factors. Factors are very important in data analysis, so start learning how to create, subset, and compare them now.
- 5
Data frames
FreeMost datasets you will be working with will be stored as data frames. By the end of this chapter, you will be able to create a data frame, select interesting parts of a data frame, and order a data frame according to certain variables.
What's a data frame?100 xpQuick, have a look at your dataset100 xpHave a look at the structure100 xpCreating a data frame100 xpCreating a data frame (2)100 xpSelection of data frame elements100 xpSelection of data frame elements (2)100 xpOnly planets with rings100 xpOnly planets with rings (2)100 xpOnly planets with rings but shorter100 xpSorting100 xpSorting your data frame100 xp - 6
Lists
FreeAs opposed to vectors, lists can hold components of different types, just as your to-do lists can contain different categories of tasks. This chapter will teach you how to create, name, and subset these lists.

Jonathan Cornelissen
Co-founder of DataCamp
Jonathan Cornelissen is one of the co-founders of DataCamp and the initial DataCamp CEO, and is interested in everything related to data science, education and entrepreneurship. He holds a PhD in financial econometrics, and was the original author of an R package for quantitative finance.
More information at: jonathancornelissen.com
Follow @cornelissenjo or here
Read on Medium
Connect on Linkedin
More information at: jonathancornelissen.com
Follow @cornelissenjo or here
Read on Medium
Connect on Linkedin
What do other learners have to say?
Join over 10 million learners and start Introduction to R today!
Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.