Extract the first, last, or nth value from a vector.
Note: These are simple wrappers around vctrs::vec_slice()
.
nth.(x, n, default = NULL, na_rm = FALSE)
A vector
For nth()
, a number specifying the position to grab.
The default value if the value doesn't exist.
If TRUE
ignores missing values.