forked from ropensci/CRediTas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
91 lines (58 loc) · 3.73 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
# collapse = TRUE,
# comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# CRediTas
<!-- badges: start -->
[![R-CMD-check](https://github.com/jospueyo/CRediTas/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/jospueyo/CRediTas/actions/workflows/R-CMD-check.yaml)
[![Status at rOpenSci Software Peer Review](https://badges.ropensci.org/576_status.svg)](https://github.com/ropensci/software-review/issues/576)
<!-- badges: end -->
The goal of CRediTas is to facilitate the tedious job of creating [CRediT authors statements](https://credit.niso.org/) for scientific publications. Normally, the first author of a scientific paper organizes a table in a spreadsheet where all the authors self-state their contributions. Often too, it is the first author responsibility to state the contributions of all co-authors. However, at the end, the information has to be translated to the CRediT statement format of "Author 1: roles Authors 2: roles ..." which is prone to errors and tedious, especially if there are many co-authors. The CRediTas package aims to make this easier by providing a template to be filled in form of a table (csv) and then converting this table to CRediT statement format.
## Installation
You can install the development version of CRediTas from [GitHub](https://github.com/) with:
``` r
# install.packages("remotes")
remotes::install_github("jospueyo/CRediTas")
```
## Example
The workflow is meant to work with three basic functions. First, we create a template table. It can be created as a `data.frame` and being populated in R. Or as a csv file and being populated in your preferred csv editor.
```{r create_template}
library(CRediTas)
template_create(authors = c("Alexander Humboldt", "Carl Ritter"), file = tempfile())
cras_table <- template_create(authors = c("Friedrich Ratzel",
"Pau Vidal de la Blache",
"Pau Vila",
"Élisée Reclus"))
knitr::kable(cras_table)
```
As you can see, the table is empty. So you must provide the information of who did what. You can use the `fix` function to fill the template directly in R:
```{r fix, eval=FALSE}
fix(cras_table)
```
If you wrote the template to a file, then you can read it back to R as follows:
```{r template_read, eval=FALSE}
cras_table <- template_read(path_to_your_csv_file)
```
Once the `cras_table` is populated, for instance:
```{r populate_random, echo=FALSE}
cras_table[-3, -1] <- sample(0:1, size=3*14, replace = TRUE, prob = c(0.6, 0.4))
knitr::kable(cras_table)
```
A text file can be generated following the CRediT author statement format. Since `drop = TRUE` by default, the authors without contribution are removed from the statement, Pau Vila in this case.
```{r}
textfile <- tempfile()
cras_write(cras_table, textfile, markdown = TRUE, quiet = TRUE)
```
If you open the text file, you will find this:
`r cras_write(cras_table, markdown = TRUE, quiet = TRUE)`
## Related packages
- [tenzing](https://github.com/marton-balazs-kovacs/tenzing/): Tenzing, an easy-to-use web-based app, allows researchers to generate reports about the contribution of each team member on a project using CRediT, for insertion into their manuscripts and for publishers to potentially incorporate into article metadata.
- [contribution](https://github.com/openbiox/contribution): The goal of contribution is to generate contribution table for credit assignment in a project. This is inspired by Nick Steinmetz (see twitter https://twitter.com/SteinmetzNeuro/status/1147241138291527681).