nth_help | R Documentation |
Extract the n
-th, n
-th from last, first n
, and last n
elements of a vector of list.
nth_help()
.nth(x, n)
.first_n(x, n)
.last_n(x, n)
.nth_from_last(x, n)
.nth_plus(x, n)
x |
A populated vector to extract elements from. |
n |
A complete positive whole-number scalar. |
A scalar, vector, or vlist.
.nth()
: Gets the n
-th element(s) of x
.
.first_n()
: Gets the first n
elements of x
.
.last_n()
: Gets the last n
elements of x
.
.nth_from_last()
: Gets the n
th from last element(s) of x
.
.nth_plus()
: Gets element n
and onwards of x
.
.nth_from_last(letters, 5)
.nth_plus(letters, 5)
.first_n(letters, 5)
.last_n(letters, 5)
.nth(letters, 5:7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.