Learn R Programming

tern (version 0.9.8)

to_n: Replicate entries of a vector if required

Description

[Stable]

Replicate entries of a vector if required.

Usage

to_n(x, n)

Value

x if it has the required length already or is NULL, otherwise if it is scalar the replicated version of it with n entries.

Arguments

x

(numeric)
vector of numbers we want to analyze.

n

(integer(1))
number of entries that are needed.