recycle_better: Recycle a vector using names and smart rules

Description Usage Arguments Value

Description

Recycle a vector using names and smart rules

Usage

1
recycle_better(vec, vecnames, default = 0)

Arguments

vec

A numeric vector used for recycling. If the vector is not named, then it is simply recycled N times where N = length(vecnames). If it is a named numeric, then a vector of length N is built using the default argument below, then those named values are inserted in the result.

vecnames

The ordered names to assign to the results.

default

The default value to pad the vector with when a named vec argument is provided.

Value

Returns a vector of length(vecnames) that is named and ordered as vecnames.


jeanmarcgp/xtsanalytics documentation built on May 19, 2019, 12:38 a.m.