The R programming language uses indices that start from 1, but sometimes it might be handy to be able to index from zero, as is more typical in mathematical notation and some other programming languages like C and Python.
Install the development version of index0 from GitHub with:
This R package index0 provides the index0
class. Subsetting and operations using [
will index from zero rather than one. To return to normal behaviour, use as.index1
or just remove the index0
class from your object.
What is the zeroth letter of the alphabet? What is the zeroth number in our set?
What are the first, second and fourth letters?
Replace the first and third numbers with NA
: