decorator: Creates string decorators by repeating a pattern

Description Usage Arguments Value Author(s) See Also Examples

Description

Creates string decorators by repeating a pattern either a given number of times or so that it takes a given number of character

Usage

1
2
3
txt %x=% n
txt %x=|% length.out
strrep( txt, n, length.out=getOption("width") )

Arguments

txt

Pattern to repeat

n

Number of times to repeat the pattern

length.out

number of character the output should be

Value

A character string

Author(s)

Romain Francois <francoisromain@free.fr>

See Also

paste, sprintf, rep

Examples

1
2
3
4
5
"=" %x=% 80
"<-+->" %x=|% 80
strrep( ".-", n = 10 )
strrep( ".-", length.out = 50 )
strrep( ".-" )

Example output

Attaching package: 'operators'

The following objects are masked from 'package:base':

    options, strrep

[1] "================================================================================"
[1] "<-+-><-+-><-+-><-+-><-+-><-+-><-+-><-+-><-+-><-+-><-+-><-+-><-+-><-+-><-+-><-+->"
[1] ".-.-.-.-.-.-.-.-.-.-"
[1] ".-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-"
[1] ".-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-"

operators documentation built on May 2, 2019, 2:47 p.m.