Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

repChar

Make Simple String from Repeating a Character, e.g. Blank String


Description

Simple constructors of a constant character string from one character, notably a “blank” string of given string length.

M.M. is now ‘mentally deprecatingbl.string in favor of using repChar() in all cases.

With R 3.3.0 (May 2016), the new function strrep() was introduced; it is faster typically, and more flexible, e.g. accepting a vector for the 2nd argument.
This (for now informally) deprecates all uses of repChar() and bl.string().

Usage

repChar(char, no)
bl.string(no)

Arguments

char

single character (or arbitrary string).

no

non-negative integer.

Value

One string, i.e., character(1)), for bl.string a blank string, fulfilling n == nchar(bl.string(n)).

Author(s)

Martin Maechler, early 1990's (for bl.string).

See Also

Examples

r <- sapply(0:8, function(n) ccat(repChar(" ",n), n))
cbind(r)

repChar("-", 4)
repChar("_", 6)
## it may make sense to a string of more than one character:
repChar("-=- ", 6)

## show the very simple function definitions:
repChar
bl.string

sfsmisc

Utilities from 'Seminar fuer Statistik' ETH Zurich

v1.1-11
GPL (>= 2)
Authors
Martin Maechler [aut, cre] (<https://orcid.org/0000-0002-8685-9910>), Werner Stahel [ctb] (Functions: compresid2way(), f.robftest(), last(), p.scales(), p.dnorm()), Andreas Ruckstuhl [ctb] (Functions: p.arrows(), p.profileTraces(), p.res.2x()), Christian Keller [ctb] (Functions: histBxp(), p.tachoPlot()), Kjetil Halvorsen [ctb] (Functions: KSd(), ecdf.ksCI()), Alain Hauser [ctb] (Functions: cairoSwd(), is.whole(), toLatex.numeric()*), Christoph Buser [ctb] (to function Duplicated()), Lorenz Gygax [ctb] (to function p.res.2fact()), Bill Venables [ctb] (Functions: empty.dimnames(), primes()), Tony Plate [ctb] (to inv.seq()), Isabelle Fl<fc>ckiger [ctb], Marcel Wolbers [ctb], Markus Keller [ctb], Sandrine Dudoit [ctb], Jane Fridlyand [ctb], Greg Snow [ctb] (to loessDemo()), Henrik Aa. Nielsen [ctb] (to loessDemo()), Vincent Carey [ctb], Ben Bolker [ctb], Philippe Grosjean [ctb], Fr<e9>d<e9>ric Ibanez [ctb], Caterina Savi [ctb], Charles Geyer [ctb], Jens Oehlschl<e4>gel [ctb]
Initial release
2021-04-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.