REPT: Basic REPT function from excel

Description Usage Arguments Value Examples

View source: R/REPT.R

Description

It acts similiarly to Excel's REPT function. Repeat the text as many times as you want.

Usage

1
REPT(text, number_times, AsOne = TRUE)

Arguments

text

Which text should it repeat n time?

number_times

How many times should the function repeat the given text.

AsOne

Should function concatenate the text or should it return seperately as a vector(Vector is same as array in Excel)

Value

In the first example we repeat "Oi" 2 times and it is coerced together as one string. In the second example we don't coerce it together but it still repeats the "Oi" two times. Function will always return character class.

Examples

1
2
REPT("Oi",2,AsOne = TRUE)
REPT("Oi",2,AsOne = FALSE)

ExcelFunctionsR documentation built on July 1, 2020, 8:35 p.m.