recycle: Expands data to a given length through recycling.

Description Usage Arguments Value Examples

Description

This function is a helper function designed call rep_len to expand the length of a data vector, but which can dynamically retrieve N from the surrounding level call for use in fabricatr.

Usage

1
recycle(x, .N = NULL)

Arguments

x

Data to recycle into length N

.N

the length to recycle the data to, typically provided implicitly by a or fabricate call wrapped around the function call.

Value

A vector of data padded to length N

Examples

1
2
3
4
fabricate(
  N = 15,
  month = recycle(month.abb)
)

DeclareDesign/fabricatr documentation built on May 6, 2019, 1:57 p.m.