nth: Every Nth Element of a Vector

nthR Documentation

Every Nth Element of a Vector

Description

Every nth element of a vector.

Usage

nth(x, n, first = 1L)

Arguments

x

a vector (or a list)

n

an integer

first

where to start

Details

Subsets are chosen with Extract, so for a list a new list is returned.

Value

a vector (or a list)

Author(s)

Enrico Schumann

See Also

Extract

Examples

nth(1:20, 2, 1)
nth(1:20, 2, 2)

enricoschumann/esutils documentation built on Feb. 2, 2024, 10:03 a.m.