Variable assignment (<- and =)
📖 Scenario: You are learning how to store information in R using variables. Variables are like labeled boxes where you keep values. In R, you can assign values to variables using two common symbols: <- and =.Imagine you want to keep track of the number of apples you have. You can put that number in a box called apples using either <- or =.
🎯 Goal: You will create two variables called apples and oranges. You will assign the number 10 to apples using <- and the number 5 to oranges using =. Then you will print both variables to see their values.
📋 What You'll Learn
Create a variable called
apples and assign it the value 10 using <-Create a variable called
oranges and assign it the value 5 using =Print the value of
applesPrint the value of
oranges💡 Why This Matters
🌍 Real World
Variables let you store data like counts, names, or measurements so your program can use them later.
💼 Career
Understanding variable assignment is a basic skill needed for all programming jobs, including data analysis and software development.
Progress0 / 4 steps