reduce_vec: Reduces vector length

View source: R/r.R

reduce_vecR Documentation

Reduces vector length

Description

Reduces length of vectors by keeping every nth element.

Usage

reduce_vec(x, nth, start.with = 1)

Arguments

x

Input vector of any type.

nth

Numeric value. Every nth element is kept. If 1, every element is kept. If 2, every second element is kept, etc.

start.with

Element at which the counting starts. Defaults to 1. E.g. if nth = 2 and length of x is 6, the first, third and fifth element is returned.

Value

Vector of the same class as x. Content depends on parameter adjustments.


kueckelj/SPATA2 documentation built on March 16, 2024, 10:25 a.m.