R/nth.R
nth.Rd
Get the value from a vector with its position.
nth(v, n = 1)
A vector
A single integer specifying the position. Default uses 1. Negative integers index from the end (i.e. -1L will return the last value in the vector). If a double is supplied, it will be silently truncated.
1
A single value.
x = 1:10 nth(x, 1)#> [1] 1nth(x, 5)#> [1] 5nth(x, -2)#> [1] 9