as.markdown: Function to transform statquote objects to strings suitable for markdown
Description
This function coerces statquote objects to strings suitable for rendering in markdown.
Quotes and sources are placed within output
formatted via the sprintf function.
This function formats a statquote object to the tagged key:value format used for
maintaining the statquotes database. The key names are:
quo: This is a quotation.
src: Person or persons who said or wrote the quote.
cit: Citation for the original quote.
url: URL where the quote can be found (such as journal articles).
tag: Comma-separated tags to categorize the quote.
tex: TeX-formatted citation
Usage
as.markdown(quotes, form = "> *%s* -- %s\n\n", cite = TRUE)
as.tagged(quotes, qid = TRUE)
Value
character vector of formatted markdown quotes
A character vector of lines
Arguments
quotes
an object of class statquote returned from functions such as
search_quotes or statquote
form
structure of the markdown output for the text (first argument)
and source (second argument) passed to sprintf
cite
logical; should the cite field be included in the source output?
qid
logical. Should the quote id number `qid` be included in the output?