Overview - Variable assignment (<- and =)
What is it?
Variable assignment in R is how you store values in names so you can use them later. You can assign values using two main symbols: the arrow <- and the equals sign =. Both put the value on the right into the name on the left. This lets you save numbers, text, or results of calculations for reuse.
Why it matters
Without variable assignment, you would have to repeat calculations or data every time you want to use them, which is slow and error-prone. Assignment lets you keep data handy and change it easily. It makes your code clearer and more efficient, like labeling boxes so you know what's inside without opening them.
Where it fits
Before learning variable assignment, you should understand basic R syntax and data types like numbers and strings. After mastering assignment, you can learn about functions, data structures like vectors and lists, and how to manipulate data efficiently.