enum: Enumerate elements inline, in bullet-list, or in...

Description Usage Arguments Value Examples

Description

This is a wrapper for functions enum_inline, enum_bullet, and enum_numbered. If bullet or init option is neither NULL nor FALSE, then it generates a bullet list or a numbered list appropriately. Otherwise, it enumerates the elements inline. If both bullet and init options are neither NULL nor FALSE, a numbered list precedes a bullet list.

Usage

1
enum(xs, sep = ",", bullet = NULL, init = NULL)

Arguments

xs

a vector of elements to be enumerated

sep

a character string to separate the elements if inline

bullet

possibly bool or a character string. If TRUE, returns a bullet list with default bullet points. If a character string is given, uses the string as bullet points.

init

possibly bool or a number. If TRUE, returns a numbered list with default numbers. If a number is given, uses the number to start enumeration with.

Value

a character string enumerating the elements

Examples

1
2
3
enum(1:3) #=> "1, 2, and 3"
enum(1:3, bullet = TRUE) #=> "- 1\n- 2\n- 3"
enum(1:3, init = 2) #=> "2. 1\n3. 2\n4. 3"

mnacamura/writtils documentation built on June 28, 2019, 9:06 p.m.