R is a free and open-source programming language that is popular in the field of data analytics. Learning R is a great way to work with data.
Each section in this course has a set of examples, exercises, and quizzes to help you learn.
Course Outline
In this course, you'll learn how to:
Select columns
Visualize data
Filter rows
Summarize and group data
Create columns
Let’s get started!
What is R?
R is a programming language popular among data analysis, social scientists, and computer programmers. It is software program that you run by typing code.
What is the Tidyverse?
People extend R by bundling code they wrote into packages. Tidyverse is a set of R packages that help simplify common data tasks.
Your first line of code
The following code is interactive. You can run the code by clicking the run button. The code will print “Hello World!” in the console.
hello world
Exercise 1.1
It’s your turn now. Type print("Hello World!") in the code editor below and click the run button.
hello world
Congratulations! You’ve written your first line of code in R.
Exploring an Example dataset
In this course, we’ll create a simple dataset and use it to learn R and the Tidyverse. This is a dataset of flowers with their names, height (centimeters), season, sunlight (hours), and growth rate.
name
height
season
sunlight
growth
Poppy
75
Spring
8.3
fast
Rose
150
Summer
6.4
slow
Zinnia
60
Summer
8.7
fast
Peony
90
Spring
7.2
slow
To create a dataframe, we can use the data.frame() function.
Exercise 1.2
Try running the following code.
flowers
Installing and loading the tidyverse package
To install the tidyverse package, we need to run this code. You only need to do this once on your computer.
Now, whenever you are using R and need to use the tidyverse, make sure to load the package by adding this line in the beginning and running it.
Review
We made it through the first section! We learned how to print “Hello World!” in the console, create a simple dataset, and install and load the tidyverse package.