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
.
Arguments
- text
character(1)
. Text.- ordered
logical(1)
.- asis
logical(1)
. Set this toTRUE
when using the function inside a loop or inside an R Markdown chunk with 'results = "asis"
' enabled.
Value
asis = TRUE
:knitr::asis_output()
return.asis = FALSE
:writeLines()
return.
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
#>