Learn R Programming

formatters (version 0.5.0)

spread_integer: spread x into len elements

Description

spread x into len elements

Usage

spread_integer(x, len)

Value

if x is a scalar "whole number" value (see is.wholenumber), the value x repeated len times. If not, an error is thrown.

Arguments

x

numeric(1). The number to spread

len

numeric(1). The number of times to repeat x

Examples

Run this code
spread_integer(3, 1)
spread_integer(0, 3)
spread_integer(1, 3)
spread_integer(2, 3)
spread_integer(3, 3)
spread_integer(4, 3)
spread_integer(5, 3)
spread_integer(6, 3)
spread_integer(7, 3)

Run the code above in your browser using DataLab