Let's learn some basic commands in R. We'll use them later in our course.
The simplest thing in R is to create a variable and save it. Imagine that you work in the zoo and you want to record how many lions are in the zoo. To do that, you go to the lion enclosure and count them: there are five lions. To save this information in R, you type the following:
lions <- 5
<- is the assignment operator: it assigns everything that is on its right to variable placed on its left. Here we assign the number 5 to the variable called
To call this new variable and check whether it was properly saved, just type its name,
lions, in the next line: