An R package for documenting scholarly contributions.
Last update: 2024-12-16
The goal of contributoR is to facilitate the documentation of scholarly contributions. This package uses CRediT (Contributor Roles Taxonomy) to visualize contributor roles.
Specifically, CRediT is a “high-level taxonomy, including 14 roles, that can be used to represent the roles typically played by contributors to scientific scholarly output. The roles describe each contributor’s specific contribution to the scholarly output” (see website for more details: https://casrai.org/credit/).
There are 14 roles, which are defined as follows:
You can install the development version from GitHub with:
install.packages("devtools")
devtools::install_github("jvcasillas/contributoR")
To create a CRediT
visualization you need to use the contributor
function. This function takes a single argument, a list, which assigns
any of the 14 contributor roles to an individual. In other words, the
name of the list element is the name of the contributor and any numbers
included for that individual correspond with 1-14 in the list of roles.
For example…
library("contributoR")
# Create example list
ex_1 <- list(
JVC = 1:13,
JGP = 1,
NR = c(2, 4))
# Plot contributions
contributor(contributions = ex_1)
You can also build the list directly inside the contributor
function.
# Build list inside function
contributor(
contributions = list(
"Author 1" = seq(1, 14, by = 3),
"Author 2" = c(1, 3, 5, 7, 9, 13),
"Lazy person" = NA,
"Author 3" = c(2, 4, 8, 14),
"Advisor" = 12)
)
It is also possible to quantify how much one contributes by adding
weight
to the list. For example:
contributions <- list(
p1 = tibble::tibble(role = 1:3, weight = c("low", "med", "high")),
p2 = tibble::tibble(role = 3:8, weight = "high"),
p3 = tibble::tibble(role = 1:3, weight = "high"),
p4 = tibble::tibble(role = 5:12, weight = rep(c("low", "high"), times = 4)))
contributor(contributions, weight = T, option = "C", begin = 0.4, end = 0.9)
If weights are included, the plot generates points that differ in color
based on the number of weights specified in the list. By default
contributor
uses the viridis
color palettes for discrete variables,
thus it is possible to include arguments like option
, begin
, and
end
to customize the point colors.
It is also possible to use the dataframe generated by contributoR
to
print contributions in prose. This can be useful if you have a large
list of co-authors.
contributions_in_prose <- contributor_df_builder(ex_1) |>
contribution_to_text()
Now I can use in-line R code to print contributions_in_prose
like
this:
The authors made the following contributions: `r contributions_in_prose`
The authors made the following contributions: JVC: Conceptualization, Data curation, Formal Analysis, Funding acquisition, Investigation, Methodology, Project administration, Resources, Software, Supervision, Validation, Visualization, Writing - original draft; JGP: Conceptualization; NR: Data curation, Funding acquisition.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.