If you do not want to use the tenzing app, you can use the package from R to achieve the same outputs.
First, you have to install the package.
# install.packages("devtools")
devtools::install_github("marton-balazs-kovacs/tenzing")
Second you have to load the package.
The contributors table template is built in the package, as well as uploaded to the net. If you choose to fill out the template with your CRediT information locally, you can write your contributors table as an xlsx file to your working directory from the package with the following code:
# install.packages("writexl")
writexl::write_xlsx(contributors_table_template, "my_contributors_table.xlsx")
To get more information on the contributors table template use the ?tenzing::contributors_table_template
command.
Note: This produces the same result as downloading the contributors table template from the link provided before.
Note: The contributors table template was changed since the first release, as some of the CRediT roles were not named properly in the template columns.
You can load the contributors table into R with the tenzing::read_contributors_table
function. This function accepts files with csv, tsv, xlsx extensions, and the share URL of the Google spreadhseet. As an example we will use the built in contributors table template.
file_path <- system.file("extdata", "contributors_table_example.csv", package = "tenzing", mustWork = TRUE)
my_contributors_table <- read_contributors_table(contributors_table_path = file_path)
#> 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.
If the read contributors table still contains empty rows you can clean it with the clean_contributors_table
function.
my_contributors_table <- clean_contributors_table(my_contributors_table)
After loading your contributors table you have to check its validity.
check_result <- validate_contributors_table(contributors_table = my_contributors_table)
The validation function checks your contributors table by 10 statements. You can learn more about these checks by running the following code ?tenzing::contributors_table_template
.
The check can have three results: success, warning or error. You can investigate what was the output of each of the 10 checks.
purrr::map(check_result, "type")
#> $missing_surname
#> [1] "success"
#>
#> $missing_firstname
#> [1] "success"
#>
#> $duplicate_names
#> [1] "success"
#>
#> $duplicate_initials
#> [1] "success"
#>
#> $missing_order
#> [1] "success"
#>
#> $duplicate_order
#> [1] "success"
#>
#> $missing_affiliation
#> [1] "success"
#>
#> $missing_corresponding
#> [1] "success"
#>
#> $missing_credit
#> [1] "success"
#>
#> $missing_email
#> [1] "success"
If any of them is an error than the output that you will generate in the next step will be corroborated. Therefore, you have to read the messages that are accompanied with the erroneous checks and update your contributors table accordingly.
purrr::map(check_result, "message")
#> $missing_surname
#> [1] "There are no missing surnames."
#>
#> $missing_firstname
#> [1] "There are no missing firstnames."
#>
#> $duplicate_names
#> [1] "There are no duplicate names in the contributors_table."
#>
#> $duplicate_initials
#> [1] "There are no duplicate initials in the contributors_table."
#>
#> $missing_order
#> [1] "There are no missing values in the order of publication."
#>
#> $duplicate_order
#> [1] "There are no duplicated order numbers in the contributors_table."
#>
#> $missing_affiliation
#> [1] "There are no missing affiliations in the contributors_table."
#>
#> $missing_corresponding
#> [1] "There is at least one author indicated as corresponding author."
#>
#> $missing_credit
#> [1] "All authors have at least one CRediT statement checked."
#>
#> $missing_email
#> [1] "There are email addresses provided for all corresponding authors."
If your contributors table is validated you can move on to output generation. There are four different types of outputs that you can create with the tenzing app.
For the human readable report and the contributors’ affiliation page the output text will be rmarkdown formatted by default. However, by setting the text_format
argument to "html"
the output can be HTML formatted as well, or by setting the argument to "raw"
, the output string will not be formatted at all.
For this section it is possible to use initials by setting the initials
argument TRUE
. Also, if the order_by
argument is set to contributor
the function will list the contributions after the name of each researcher, instead of listing the appropriate names after each CRediT role.
print_credit_roles(contributors_table = my_contributors_table, initials = TRUE, order_by = "contributor")
#> **A.O.H.:** Conceptualization, Project administration, Validation, Writing - original draft, and Writing - review & editing.
#> **B.A.:** Conceptualization, Supervision, Validation, and Writing - review & editing.
#> **F.A.:** Conceptualization, Project administration, Software, Validation, and Writing - review & editing.
#> **J.C.:** Conceptualization, Project administration, and Validation.
#> **M.K.:** Conceptualization, Data curation, Project administration, Software, Validation, Visualization, Writing - original draft, and Writing - review & editing.
print_title_page(contributors_table = my_contributors_table)
#> Alex O. Holcombe^1*^, Marton Kovacs^2,3*^, Balazs Aczel^2^, Frederik Aust^4,5^, Julien Colomb^6^
#>
#> ^1^University of Sydney, ^2^Institute of Psychology, ELTE Eotvos Lorand University, Budapest, Hungary, ^3^Doctoral School of Psychology, ELTE Eotvos Lorand University, Budapest, Hungary, ^4^University of Cologne, Cologne, Germany, ^5^University of Amsterdam, Amsterdam, Netherlands, ^6^Humboldt University of Berlin
#>
#> *Alex O. Holcombe and Marton Kovacs are shared first authors. The corresponding author is Marton Kovacs: marton.balazs.kovacs@gmail.com.
print_xml(contributors_table = my_contributors_table)
#> {xml_document}
#> <contrib-group>
#> [1] <contrib>\n <name surname="Aczel" given-names="Balazs"/>\n <role vocab= ...
#> [2] <contrib>\n <name surname="Aust" given-names="Frederik"/>\n <role vocab ...
#> [3] <contrib>\n <name surname="Colomb" given-names="Julien"/>\n <role vocab ...
#> [4] <contrib>\n <name surname="Holcombe" given-names="Alex O."/>\n <role vo ...
#> [5] <contrib>\n <name surname="Kovacs" given-names="Marton"/>\n <role vocab ...
This output can be incorporated into manuscript created with the papaja
package.
print_yaml(contributors_table = my_contributors_table)
#> [1] "author:\n - name: Alex O. Holcombe\n affiliation: '1'\n role:\n - Conceptualization\n - Project administration\n - Validation\n - Writing - original draft\n - Writing - review & editing\n - name: Marton Kovacs\n affiliation: '2,5'\n role:\n - Conceptualization\n - Data curation\n - Project administration\n - Software\n - Validation\n - Visualization\n - Writing - original draft\n - Writing - review & editing\n corresponding: yes\n email: marton.balazs.kovacs@gmail.com\n address: Enter postal address here\n - name: Balazs Aczel\n affiliation: '2'\n role:\n - Conceptualization\n - Supervision\n - Validation\n - Writing - review & editing\n - name: Frederik Aust\n affiliation: '3,6'\n role:\n - Conceptualization\n - Project administration\n - Software\n - Validation\n - Writing - review & editing\n - name: Julien Colomb\n affiliation: '4'\n role:\n - Conceptualization\n - Project administration\n - Validation\n\naffiliation:\n - id: '1'\n institution: University of Sydney\n - id: '2'\n institution: Institute of Psychology, ELTE Eotvos Lorand University, Budapest,\n Hungary\n - id: '3'\n institution: University of Cologne, Cologne, Germany\n - id: '4'\n institution: Humboldt University of Berlin\n - id: '5'\n institution: Doctoral School of Psychology, ELTE Eotvos Lorand University, Budapest,\n Hungary\n - id: '6'\n institution: University of Amsterdam, Amsterdam, Netherlands\n"
For this section it is possible to use initials by setting the initials
argument TRUE
.
print_funding(contributors_table = my_contributors_table, initials = TRUE)
#> [1] "M.K. and J.C. were supported by Important Fund; B.A. was supported by National Funding Agency."