Learn R Programming

Tplyr (version 1.2.1)

replace_leading_whitespace: Reformat strings with leading whitespace for HTML

Description

Reformat strings with leading whitespace for HTML

Usage

replace_leading_whitespace(x, tab_width = 4)

Value

String with   replaced for leading whitespace

Arguments

x

Target string

tab_width

Number of spaces to compensate for tabs

Examples

Run this code
x <- c(" Hello there", "  Goodbye Friend ",  "\tNice to meet you",
"  \t What are you up to? \t \t ")
replace_leading_whitespace(x)

replace_leading_whitespace(x, tab=2)

Run the code above in your browser using DataLab