format_named {ThomasJeffersonUniv}R Documentation

format_named

Description

format_named

Usage

format_named(x, sep = ": ", colored = TRUE)

Arguments

x

character vector, or a list of character object. Input x must be named

sep

character scalar, see paste

colored

logical scalar, whether use two different color to separate each element, default TRUE

Value

Function format_named returns a character vector.

Examples

x1 = c(a = 1, bc = '2\n3')
cat(format_named(x1), sep = '\n')

x2 = list(a = '1\n2', b = character(), cd = '3\n4', efg = '5\n6\n7')
cat(format_named(x2, colored = FALSE), sep = '\n')
cat(format_named(x2), sep = '\n')

x3 = c(a = '1\n2')
cat(format_named(x3), sep = '\n')


[Package ThomasJeffersonUniv version 0.1.2 Index]