Rev Language Reference


rep - Replicate a value

'rep' creates a vector of 'n' copies of the value 'x'.

Aliases

  • replicate

Usage

rep(Integer x, Natural n)

Arguments

x : Integer (pass by reference)
The value that we replicate.
n : Natural (pass by value)
How often we replicate the value.

Return Type

Details

'rep' creates a vector of 'n' elements, each with value 'x', preserving the type of 'x' in the returned vector.

Example

rep(0.1, 3)

See Also