Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pandoc.list.return

Create a list


Description

Creates a Pandoc's markdown format list from provided character vector/list.

Usage

pandoc.list.return(elements, style = c("bullet", "ordered", "roman"),
  loose = FALSE, add.line.breaks = TRUE, add.end.of.list = TRUE,
  indent.level = 0, missing = panderOptions("missing"), ...)

Arguments

elements

character vector of strings

style

the required style of the list

loose

adding a newline between elements

add.line.breaks

adding a leading and trailing newline before/after the list

add.end.of.list

adding a separator comment after the list

indent.level

the level of indent

missing

string to replace missing values

...

extra arguments passed by from parent call, disregarded

Value

By default this function outputs (see: cat) the result. If you would want to catch the result instead, then call the function ending in .return.

References

John MacFarlane (2012): _Pandoc User's Guide_. http://johnmacfarlane.net/pandoc/README.html

Examples

## basic lists
pandoc.list(letters[1:5])
pandoc.list(letters[1:5])
pandoc.list(letters[1:5], 'ordered')
pandoc.list(letters[1:5], 'roman')
pandoc.list(letters[1:5], loose = TRUE)

## nested lists
l <- list("First list element",
  rep.int('sub element', 5),
  "Second element",
  list('F', 'B', 'I', c('phone', 'pad', 'talics')))
pandoc.list(l)
pandoc.list(l, loose = TRUE)
pandoc.list(l, 'roman')

## complex nested lists
pandoc.list(list('one', as.list(2)))
pandoc.list(list('one', list('two')))
pandoc.list(list('one', list(2:3)))

pander

An R 'Pandoc' Writer

v0.6.3
AGPL-3 | file LICENSE
Authors
Gergely Daróczi [aut, cre] (<https://orcid.org/0000-0003-3149-8537>), Roman Tsegelskyi [aut]
Initial release
2018-11-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.