The function generates rmarkdown formatted text of the contributions according to the CRediT taxonomy. The output is generated from an contributors_table validated with the validate_contributors_table() function. The contributors_table must be based on the contributors_table_template(). The function can return the output string as rmarkdown or html formatted text or without any formatting.

print_credit_roles(
  contributors_table,
  text_format = "rmd",
  initials = FALSE,
  order_by = "role"
)

Arguments

contributors_table

Tibble. Validated contributors_table

text_format

Character. Formatting of the returned string. Possible values: "rmd", "html", "raw". "rmd" by default.

initials

Logical. If true initials will be included instead of full names in the output

order_by

Character. Whether the contributing authors listed for each role ("role"), or the roles are listed after the name of each contributor ("contributor").

Value

The function returns a string containing the CRediT roles with the contributors listed for each role they partake in.

Warning

The function is primarily developed to be the part of a shiny app. As the validation is handled inside of the app separately, the function can break with non-informative errors if running locally without first validating it.

See also

Other output functions: print_funding(), print_title_page(), print_xml(), print_yaml()

Examples

example_contributors_table <- read_contributors_table( contributors_table = system.file("extdata", "contributors_table_example.csv", package = "tenzing", mustWork = TRUE))
#> Rows: 5 Columns: 24
#> ── Column specification ──────────────────────────────────────────────────────── #> Delimiter: "," #> chr (7): Firstname, Middle name, Surname, Email address, Primary affiliatio... #> dbl (1): Order in publication #> lgl (16): Conceptualization, Data curation, Formal analysis, Funding acquisi...
#> #> Use `spec()` to retrieve the full column specification for this data. #> Specify the column types or set `show_col_types = FALSE` to quiet this message.
validate_contributors_table(contributors_table = example_contributors_table)
#> $missing_surname #> $missing_surname$type #> [1] "success" #> #> $missing_surname$message #> [1] "There are no missing surnames." #> #> #> $missing_firstname #> $missing_firstname$type #> [1] "success" #> #> $missing_firstname$message #> [1] "There are no missing firstnames." #> #> #> $duplicate_names #> $duplicate_names$type #> [1] "success" #> #> $duplicate_names$message #> [1] "There are no duplicate names in the contributors_table." #> #> #> $duplicate_initials #> $duplicate_initials$type #> [1] "success" #> #> $duplicate_initials$message #> [1] "There are no duplicate initials in the contributors_table." #> #> #> $missing_order #> $missing_order$type #> [1] "success" #> #> $missing_order$message #> [1] "There are no missing values in the order of publication." #> #> #> $duplicate_order #> $duplicate_order$type #> [1] "success" #> #> $duplicate_order$message #> [1] "There are no duplicated order numbers in the contributors_table." #> #> #> $missing_affiliation #> $missing_affiliation$type #> [1] "success" #> #> $missing_affiliation$message #> [1] "There are no missing affiliations in the contributors_table." #> #> #> $missing_corresponding #> $missing_corresponding$type #> [1] "success" #> #> $missing_corresponding$message #> [1] "There is at least one author indicated as corresponding author." #> #> #> $missing_credit #> $missing_credit$type #> [1] "success" #> #> $missing_credit$message #> [1] "All authors have at least one CRediT statement checked." #> #> #> $missing_email #> $missing_email$type #> [1] "success" #> #> $missing_email$message #> [1] "There are email addresses provided for all corresponding authors." #> #>
print_credit_roles(contributors_table = example_contributors_table)
#> **Conceptualization:** Alex O. Holcombe, Marton Kovacs, Balazs Aczel, Frederik Aust, and Julien Colomb. #> **Data curation:** Marton Kovacs. #> **Project administration:** Alex O. Holcombe, Marton Kovacs, Frederik Aust, and Julien Colomb. #> **Software:** Marton Kovacs and Frederik Aust. #> **Supervision:** Balazs Aczel. #> **Validation:** Alex O. Holcombe, Marton Kovacs, Balazs Aczel, Frederik Aust, and Julien Colomb. #> **Visualization:** Marton Kovacs. #> **Writing - original draft:** Alex O. Holcombe and Marton Kovacs. #> **Writing - review & editing:** Alex O. Holcombe, Marton Kovacs, Balazs Aczel, and Frederik Aust.