Learn R Programming

rtables (version 0.4.0)

indent_string: Indent Strings

Description

Used in rtables to indent row names for the ASCII output.

Usage

indent_string(x, indent = 0, incr = 2, including_newline = TRUE)

Arguments

x

a character vector

indent

a vector of length length(x) with non-negative integers

incr

non-negative integer: number of spaces per indent level

including_newline

boolean: should newlines also be indented

Value

x indented by left-padding with codeindent*incr white-spaces.

Examples

Run this code
# NOT RUN {
indent_string("a", 0)
indent_string("a", 1)
indent_string(letters[1:3], 0:2)
indent_string(paste0(letters[1:3], "\n", LETTERS[1:3]), 0:2)

# }

Run the code above in your browser using DataLab