Skip to contents

Print a string of comma separated, quoted values.

Usage

pretty_print(x, max = 6, quote = TRUE)

Arguments

x

A character vector.

max

An integer.

quote

TRUE or FALSE.

Value

string

Examples

#----------------------------------------------------------------------------
# pretty_print() examples
#----------------------------------------------------------------------------
library(bkmisc)

lapply(list(integer(0), 1L, 1:2, 1:4, 1:5, 1:6, 1:7, 1:10), pretty_print)
#> [[1]]
#> [1] ""
#> 
#> [[2]]
#> [1] "'1'"
#> 
#> [[3]]
#> [1] "\"'1', '2'\""
#> 
#> [[4]]
#> [1] "\"'1', '2', '3', '4'\""
#> 
#> [[5]]
#> [1] "\"'1', '2', '3', '4', '5'\""
#> 
#> [[6]]
#> [1] "\"'1', '2', '3', '4', '5', '6'\""
#> 
#> [[7]]
#> [1] "\"'1', '2', '3', '4', '5', '6', ...\""
#> 
#> [[8]]
#> [1] "\"'1', '2', '3', '4', '5', '6', ...\""
#>