r_help: Error-checked wrappers for 'base::rep'

View source: R/r.R

r_helpR Documentation

Error-checked wrappers for base::rep

Description

These functions atomize ... arguments, converting them to an atomic vector before replication.

Usage

r_help()

r(r, ...)

e(e, ...)

re(r, e, ...)

er(e, r, ...)

Arguments

r

A complete positive whole-number scalar giving the number of replications of entire vectors.

...

One or more objects containing atomic values to be replicated (atomized before replication).

e

A complete positive whole-number scalar giving the number of times each value is to be replicated in place.

Value

An atomic vector.

Functions

  • r(): Calls rep.int(av(...), r).

  • e(): Calls rep.int(av(...), each = e).

  • re(): Calls rep(av(...), times = r, each = e).

  • er(): Calls rep(av(...), times = r, each = e).

Examples

r(2, 0:2, 3)
e(3, 0:2, 3)
re(2, 3, 0:2, 3)

j-martineau/uj documentation built on Sept. 14, 2024, 4:40 a.m.