spc: Print a character a specified number of times.

View source: R/NCmisc.R

spcR Documentation

Print a character a specified number of times.

Description

Returns 'char' X_i number of times for each element i of X. Useful for padding for alignment purposes.

Usage

spc(X, char = " ")

Arguments

X

numeric vector of number of repeats

char

The character to repeat (longer will be shortened)

Value

returns vectors of strings of char, lengths X

Author(s)

Nicholas Cooper njcooper@gmx.co.uk

See Also

rmv.spc

Examples

cat(paste(spc(9),"123\n"))
cat(paste(spc(8),"1234\n"))
spc(c(1:5),".")

NCmisc documentation built on Oct. 17, 2022, 5:09 p.m.