Indexing
One-Based Indexing
R uses one-based indexing, meaning the first element has index 1
.
Negative Indexing (Exclusion)
Negative indices in R exclude elements at those positions.
Multi-Level Indexing
Access nested structures using $
for named elements or multiple brackets.
Slicing
Use :
to get ranges of indices (inclusive), or functions like seq()
.
Common Indexing Errors
Some frequent indexing issues in R.