Overview - Vector indexing (1-based)
What is it?
Vector indexing in R means selecting elements from a vector using numbers that show their position. R uses 1-based indexing, which means counting starts at 1, not 0. This lets you pick specific items or groups of items from a list of values. Understanding this helps you work with data efficiently in R.
Why it matters
Without knowing vector indexing, you can't easily access or change parts of your data. If R used 0-based indexing like some other languages, beginners might get confused because R's counting starts at 1. This difference affects how you write code and avoid mistakes when handling data. Knowing this makes your data work smoother and less error-prone.
Where it fits
Before learning vector indexing, you should understand what vectors are in R and basic R syntax. After mastering indexing, you can learn about more complex data structures like matrices and data frames, and how to manipulate them using indexing.