In general we are used to seeing that collection type objects, I am talking about lists, arrays, matrices, recordsets, or whatever they are called in any language, are "indexed" starting at position 0. However, in R
, for some decision By design, any objects (in fact R
there are no scalar objects) are "indexed" starting at 1.
> vector <- c(1,2,3)
> vector[1]
[1] 1
> vector[0]
numeric(0)
Historically speaking, what motivated this decision? Does it have any particular advantage over "indexing" starting at 0?