list_out: List vector elements in a nice format

Description Usage Arguments Value Examples

View source: R/list_out.R

Description

Oftentimes in my functions I like to list out the accepted arguments if the user enters one that is not accepted. This function faciliates that.

Usage

1
list_out(x, final = NULL, per_line = 1e+06, wrap = NULL, indent = NULL)

Arguments

x

a vector object, will be coerced to a character class

final

character vector of length == 1: word that will separate the final element in the list from others. See the examples

per_line

numeric vector of length == 1: number of elements printed per line. See the examples

wrap

character vector of length == 1: optional character to wrap around each element, e.g., quotation marks

indent

character vector of length == 1: anything you wish to place in front of the first element on each line. See the examples

Value

a character vector of length == 1, ready to be passed to stop, warning, or cat, for example.

Examples

1
2
list_out(x = letters[1:10])
cat(list_out(letters[1:26], wrap = "'", per_line = 4, final = "or", indent = "  "))

bstaton1/StatonMisc documentation built on May 18, 2020, 12:06 a.m.