Skip to contents

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.

Usage

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

Arguments

text

character(1). Text.

ordered

logical(1).

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

Note

Updated 2020-07-24.

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
#>