triangle_string: Turn strings into triangle-shaped strings

View source: R/textshapes.R

triangle_stringR Documentation

Turn strings into triangle-shaped strings

Description

Turn strings into triangle-shaped strings

Usage

triangle_string(string, maxlen = 1, step = 1, display = FALSE)

Arguments

string

(character) Some text to reshape into a triangle.

maxlen

(integer) Width of top of triangle. Defaults to 1. Set larger than 1 for downward-pointing triangle.

step

(integer) Number of characters to expand or contract triangle width per line (set to negative for downward-pointing triangle)

display

(logical) Returns string invisibly if FALSE (default), set to TRUE to display returned string

Details

Use positive step argument for upward pointing triangle and negative step and wider maxlen for downward pointing triangle.

Value

A string

Examples

triangle_string("hellooooooooooooooooooooooooooooooooooooooooooooooooooo world") %>%
  multi_color()

multicolor documentation built on March 7, 2023, 7:30 p.m.