Function to transform bioacousticsquote objects to strings suitable for markdown
Source:R/as.markdown.R
as.markdown.Rd
This function coerces bioacousticsquote objects to strings suitable for rendering in markdown.
Quotes and sources are placed within output
formatted via the sprintf
function.
This function formats a bioacousticsquote object to the tagged key:value
format used for
maintaining the bioacousticsquotes 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
Arguments
- quotes
an object of class
bioacousticsquote
returned from functions such assearch_quotes
orbioacousticsquote
- 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?
Examples
ll <- search_quotes("Hempton")
as.markdown(ll)
#> [1] "> *Seuketat is the Eskimo word for ear-of-the-animal. This is what we must become if we want to truly listen.* -- Gordon Hempton, Earth is a Solar Powered Jukebox\n\n"
#> [2] "> *How can we listen for something that we have not yet heard? We can't. When we listen in this way, selectively, we are actually practicing controlled impairment.* -- Gordon Hempton, Earth is a Solar Powered Jukebox\n\n"
qitems <- search_quotes("Hempton")
cat(as.tagged(qitems[1:5,]))
#> qid:3
#> quo:Seuketat is the Eskimo word for ear-of-the-animal. This is what we must become if we want to truly listen.
#> src:Gordon Hempton
#> cit:Earth is a Solar Powered Jukebox
#> tag:listening
#>
#> qid:4
#> quo:How can we listen for something that we have not yet heard? We can't. When we listen in this way, selectively, we are actually practicing controlled impairment.
#> src:Gordon Hempton
#> cit:Earth is a Solar Powered Jukebox
#> tag:listening
#>
#> qid:NA
#> quo:NA
#>
#> qid:NA
#> quo:NA
#>
#> qid:NA
#> quo:NA
#>