-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprimed_icite_report.Rmd
139 lines (110 loc) · 3.28 KB
/
primed_icite_report.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
---
title: "PRIMED iCite report "
author: "PRIMED CC"
date: "`r lubridate::today()`"
format:
html:
toc: true
self_contained: yes
execute:
echo: false
output:
rmdformats::downcute:
fig_width: 10
fig_height: 4
thumbnails: false
css: "style.css"
params:
records_file: "tmp/icite_records.json"
search_id_file: "tmp/icite_search_id.txt"
---
```{r library, include=FALSE}
library(tidyverse)
library(knitr)
library(jsonlite)
# library(kableExtra)
# library(treemapify)
library(glue)
options(knitr.kable.NA = '--')
knitr::opts_chunk$set(echo=FALSE, message=FALSE)
theme_set(
theme_bw()
)
```
```{r}
get_pubmed_link <- function(pmid) {
return(glue::glue("[{pmid}](https://pubmed.ncbi.nlm.nih.gov/{pmid})"))
}
```
```{r}
icite_report = fromJSON(file.path(params$records_file))
search_id = readLines(params$search_id_file)
```
# Introduction
This report shows citation-based and other bibliometric results from [iCite](https://icite.od.nih.gov/) for PRIMED publications.
# All citations
```{r}
icite_analysis_url = glue("https://icite.od.nih.gov/results?search_id={search_id}")
```
View the [full iCite report for all PRIMED publications]( `r icite_analysis_url`).
The full iCite report contains information about citations to PRIMED publications by any other publication.
# Citations within PRIMED only
The PRIMED CC has also generated metrics for citations by PRIMED publications to other PRIMED publications.
```{r}
icite <- icite_report
# Rename icite data frame columns.
names(icite) = names(icite) %>% tolower() %>% str_replace_all(" ", "_")
# Tidy data such that there is one record per "cited_by".
icite <- icite %>%
unnest_longer(cited_by)
```
```{r}
# Consistency check.
chk <- icite %>%
group_by(pmid, citation_count) %>%
summarise(n_cited_by = n()) %>%
filter(citation_count != n_cited_by)
stopifnot(nrow(chk) == 0)
```
```{r}
# Subset to those that are PRIMED citations.
icite <- icite %>%
filter(cited_by %in% pmid)
```
## Total citations by publication year
The following figure shows the publication year of the *cited* publication, for PRIMED publications that were cited by another PRIMED publication.
```{r}
ggplot(icite, aes(x=year)) +
geom_bar() +
xlab("Publication year")
```
## Total citations by year cited
The following figure shows the publication year of the *citing* publication, for PRIMED publications that cited another PRIMED publication.
```{r}
x <- icite %>%
# First get the distinct set publications citing other publications
select(cited_by) %>%
# then get the year those publications were published in
left_join(icite_report, by=c("cited_by"="pmid"))
ggplot(x, aes(x=year)) +
geom_bar() +
xlab("Citation year")
```
## Most cited publications
The following table shows the 10 PRIMED publications that were most cited by other PRIMED publications.
The "number of citations" columns shows the number of other PRIMED publications citing this publication.
```{r}
most_cited = icite %>%
group_by(pmid) %>%
summarise(n_primed_citations=n()) %>%
arrange(desc(n_primed_citations)) %>%
head(10)
most_cited %>%
left_join(icite_report, by="pmid") %>%
select(pmid, n_primed_citations, year, title, authors) %>%
mutate(pmid=get_pubmed_link(pmid))%>%
rename(
`number of citations` = n_primed_citations
) %>%
kable()
```