trim: Trim an odd-length vector

Description Usage Arguments Value

Description

This function trims a vector with an odd length, leaving n elements to one or either side of the center element.

Usage

1
trim(x, n = 5, LR = 1:2)

Arguments

x

The vector to trim

n

The number of elements to one or either side of the center element to keep

LR

A vector indicating which side to keep: To keep n elements to the left, set LR = 1; to keep n elements to the right, set LR = 2; for n elements to the left and right, set LR = 1:2.

Value

A trimmed vector according to n and side.


driegert/transfer documentation built on May 15, 2019, 2:11 p.m.