expand.vec: Expand vectors

Description Usage Arguments Value Examples

Description

Ensure that a vector is the correct length, recycling length-1 inputs if necessary

Usage

1
expand.vec(x, N)

Arguments

x

vector [1] or [N]

N

target number of elements

Value

vector [N]

Examples

1
2
3
4
5
6
7
8
9
expand.vec(1, 5L)
expand.vec(1:5, 5L)

# works with lists
expand.vec(list(1), 3L)

# only recycles length-1 vectors
## Not run: expand.vec(1:3, 5L)
## Not run: expand.vec(1:3, 6L)

CJBarry/DNAPL documentation built on May 6, 2019, 9:25 a.m.