-
Notifications
You must be signed in to change notification settings - Fork 3
/
plos_author_contributions.Rmd
68 lines (55 loc) · 1.98 KB
/
plos_author_contributions.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
Author Roles and Author Positions
========================================================
```{r}
library(ggplot2)
pac <- read.csv('data/plos_author_contributions.csv', row.names=NULL)
```
You can also embed plots, for example:
```{r}
main.roles <- c(
'Conceived and designed the experiments',
'Performed the experiments',
'Analyzed the data',
'Contributed reagents/materials/analysis tools',
'Wrote the paper')
normalised.main.roles <- tolower(sub('^(\\w+).+$', '\\1', main.roles))
pac$num.contribs <- with(pac,
Conceived.and.designed.the.experiments +
Performed.the.experiments +
Analyzed.the.data +
Contributed.reagents.materials.analysis.tools +
Wrote.the.paper)
counts.conceived <- aggregate(
Conceived.and.designed.the.experiments ~ Author.Position, pac, sum)
counts.conceived$role <- 'conceived'
names(counts.conceived) <- c('position', 'count', 'role')
counts.performed <- aggregate(
Performed.the.experiments ~ Author.Position, pac, sum)
counts.performed$role <- 'performed'
names(counts.performed) <- c('position', 'count', 'role')
counts.analyzed <- aggregate(
Analyzed.the.data ~ Author.Position, pac, sum)
counts.analyzed$role <- 'analyzed'
names(counts.analyzed) <- c('position', 'count', 'role')
counts.contributed <- aggregate(
Contributed.reagents.materials.analysis.tools ~ Author.Position, pac, sum)
counts.contributed$role <- 'contributed'
names(counts.contributed) <- c('position', 'count', 'role')
counts.wrote <- aggregate(
Wrote.the.paper ~ Author.Position, pac, sum)
counts.wrote$role <- 'wrote'
names(counts.wrote) <- c('position', 'count', 'role')
counts <- rbind(counts.conceived,
counts.performed,
counts.analyzed,
counts.contributed,
counts.wrote)
for (role in normalised.main.roles) {
m <- counts$role == role
counts$rel.count[m] = counts$count[m] / sum(counts$count)
}
```
```{r}
ggplot(subset(counts, position <= 20), aes(x=position, y=role)) +
geom_point(aes(size=rel.count))
```