takes an object of class data.frame or bibliography and returns a formatted citation.

format_citation(data, details = TRUE, abstract = FALSE,
  add_html = FALSE, line_breaks = FALSE, ...)

Arguments

data

An object of class data.frame or bibliography.

details

Logical: Should identifying information such as author names & journal titles be displayed? Defaults to TRUE.

abstract

Logical: Should the abstract be shown (if available)? Defaults to FALSE.

add_html

Logical: Should the journal title be italicized using html codes? Defaults to FALSE.

line_breaks

Either logical, stating whether line breaks should be added, or numeric stating how many characters should separate consecutive line breaks. Defaults to FALSE.

...

any other arguments.

Value

a string of length == length(x), containing formatted citations.

Examples

file_location <- system.file(
  "extdata",
  "avian_ecology_bibliography.ris",
  package = "revtools")
x <- read_bibliography(file_location, return_df = FALSE)
format_citation(x[[1]])
#> [1] "A.I. Leal, A. Rainho et al. (2016) Modelling future scenarios to improve woodland landscapes for birds in the Mediterranean. Journal for Nature Conservation 30: 103-112"
format_citation(as.data.frame(x)[1, ]) # same result
#>                                                                                                                                                      1 
#> "Leal, A.I. et al. (2016) Modelling Future Scenarios to Improve Woodland Landscapes for Birds in the Mediterranean. Journal for Nature Conservation. "