-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
113 lines (83 loc) · 4.44 KB
/
Copy pathREADME.Rmd
File metadata and controls
113 lines (83 loc) · 4.44 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
---
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%"
)
```
# contribution - A Tiny Contribution Table Generator Based on ggplot2
<!-- badges: start -->
[](https://ci.appveyor.com/project/ShixiangWang/contribution)
[](https://travis-ci.org/openbiox/contribution)
[](https://lifecycle.r-lib.org/articles/stages.html#stable)
[](https://cran.r-project.org/package=contribution)
[](https://cran.r-project.org/package=contribution)
<!-- badges: end -->
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>).
> Authors contributions sections are new and still don’t appear in major journals, but can be improved. Rather than text listing each author’s contributions, the same data can be presented as a table with rows corresponding to contributions and columns for each author.
>
> Advantages include:
>
> 1. Graphics are faster and easier to comprehend. They are also easier to locate in the document.
>
> 2. This format can be readily augmented with additional information, such as distinguishing between ‘major’ and ‘minor’ contributions of each type.
>
> 3. This format can be read as easily in either direction, answering both "Who did X?" and "What did person Y do?" equally.
>
> 4. This format lends itself to a nice extension for including your author contribution information on your CV: a similar table where each column is one of your papers.
>
>
> A difficulty with this is the diversity of terminology used, which would be helped by refinement and more widespread adoption of the CRediT framework (<https://casrai.org/credit/>).
## Feature
* Support table type
* 3-level contribution (i.e. 'None', 'Minor' and 'Major')
* numeric contribution
* Dataset `palette` contains 27 color maps
An R Shiny application can be found at `https://shiny.hiplot.com.cn/contribution-table/`.
Corresponding source code is available at <https://github.com/ShixiangWang/shinyapps/tree/main/contribution-table>.
## Installation
You can install the released version of contribution from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("contribution")
```
And the development version from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("openbiox/contribution")
```
## Basic example
This is a basic example which shows you how to plot a simple contribution table:
```{r example}
library(contribution)
data("demo")
demo
```
The accepted data format is a `data.frame` whose first column show the `role` and the other
columns show the people or projects. This format is easy to create using R or other tools like Excel.
For a 3-level contribution table, only `Minor` and `Major` are valid, a `NA` value should put
in cell for no contribution.
```{r, fig.height=3}
generate(demo)
```
The **white** box represents **no contribution**, the **grey** box represents **minor contribution**,
and the **black** box represents **major contribution**.
The table is nice, easy to read. The result is a `ggplot` object, so you can modify in your way!
You can also use other colors and `scale_fill_*` function from **ggplot2** to map colors:
```{r, fig.height=3}
library(ggplot2)
generate(demo, text_angle_x = 20, color_map = scale_fill_brewer(palette ="Oranges"))
```
When it is not easy to see the meaning of color, you can show the legend.
```{r, fig.height=3}
generate(demo, text_angle_x = 20, color_map = scale_fill_brewer(palette ="Set1"), show_legend = TRUE)
```
More usage please see [online documentation](https://openbiox.github.io/contribution/).
## To do
* Support special symbol for indicating equal work in a project/paper
* Accept author contributions information in machine-readable formats, e.g. in RIS and Bibtex citation documents provided on journal websites.