Skip to contents

The function generates a YAML document containing the contributors information and contributions according to the CRediT taxonomy. The output is generated from an contributors_table based on the contributors_table_template().

Usage

print_yaml(contributors_table)

Arguments

contributors_table

validated contributors_table

Value

The function returns a YAML document

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.

Examples

example_contributors_table <-
read_contributors_table(
contributors_table = system.file("extdata",
"contributors_table_example.csv", package = "tenzing", mustWork = TRUE))
#> Rows: 3 Columns: 26
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr  (9): Firstname, Middle name, Surname, Affiliation 1, Affiliation 2, Aff...
#> 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.
print_yaml(contributors_table = example_contributors_table)
#> [1] "author:\n  John M. Smith:\n    name: John M. Smith\n    affiliation: '1,2'\n    role:\n      - Formal analysis\n      - Visualization\n    corresponding: yes\n    email: some@email.com\n    address: Enter postal address here\n  Marton Kovacs:\n    name: Marton Kovacs\n    affiliation: '1,3,4'\n    role:\n      - Data curation\n      - Methodology\n      - .na.character\n    corresponding: no\n  Lex W. Luthor:\n    name: Lex W. Luthor\n    affiliation: '2,5'\n    role:\n      - Formal analysis\n      - Funding acquisition\n      - Software\n      - Supervision\n      - .na.character\n    corresponding: no\n\naffiliation:\n  - id: 1\n    institution: Institute of Psychology, ELTE Eotvos Lorand University, Budapest,\n      Hungary, Doctoral School of Psychology\n  - id: 2\n    institution: LexCorp, Smallville, Kansas, US\n  - id: 3\n    institution: Department of Psychology\n  - id: 4\n    institution: Institute for Interstellar Relations, Oxbridge University, UK\n  - id: 5\n    institution: Metropolis University\n"