Include a Markdown-formatted list, either ordered or unordered. This function works in any R Markdown code block. When calling from inside an asis chunk, set asis = TRUE.

markdownList(text, ordered = FALSE, asis = FALSE)

Arguments

text

character(1). Header text.

ordered

logical(1). Ordered ("TRUE") or unordered ("FALSE").

asis

logical(1). Set this to TRUE when using the function inside a loop or inside an R Markdown chunk with 'results = "asis"' enabled.

Value

See also

Examples

groceries <- c("milk", "eggs") markdownList(groceries)
#> [1] "- milk\n" "- eggs\n" #> attr(,"format") #> [1] "markdown" #> attr(,"class") #> [1] "knit_asis" #> attr(,"knit_cacheable") #> [1] NA
markdownList(groceries, ordered = TRUE)
#> [1] "1. milk\n" "2. eggs\n" #> attr(,"format") #> [1] "markdown" #> attr(,"class") #> [1] "knit_asis" #> attr(,"knit_cacheable") #> [1] NA
markdownList(groceries, asis = TRUE)
#> #> - milk #> - eggs #>