Case study: specific projects
Source:vignettes/case_study_project_nums_quick.Rmd
case_study_project_nums_quick.Rmd
Compiled: 2023-12-12
This article illustrates how one might explore specific project numbers. Start by attaching our package and others we will use.
Projects
Suppose one is interested in specific projects, and the grant project numbers are known. Define and search for them.
project_nums <- c("U01CA190234", "U24CA194354")
Query the NIH Reporter for the projects of interest. The use of
project_nums=
for the argument required some reflection on
the API schema provided at the end of the API projects
endpoint.
projects <- reporter_projects(project_nums = project_nums)
Explore the data, for instance finding the Funding Opportunity Announcement the grants were reward under, and the fiscal years in which they were active.
Publications
Use the core project numbers to retrieve known publications
core_project_nums <-
pull(projects, "core_project_num") |>
unique()
publications <- reporter_publications(core_project_nums = core_project_nums)
The number of publications associated with each grant are as follows:
publications |>
count(coreproject) |>
gpc_datatable()
Many publications were attributed to both grants
publications |>
count(pmid, name = "cited_by") |>
count(cited_by) |>
gpc_datatable()
Citations
Obtain citation information (including information about the orginal
publication) using the publications
tibble
citations <- icite(publications)
There are 67 citation records, one for each publication. Explore these interactively
citations |>
select(pmid, citation_count, relative_citation_ratio, year, title) |>
gpc_datatable()
Use a ‘join’ between tables to associate publications and citations
left_join(publications, citations) |>
group_by(coreproject, year) |>
summarize(
n_publications = n(),
total_citations = sum(citation_count)
) |>
gpc_datatable()
#> Joining with `by = join_by(pmid)`
#> `summarise()` has grouped output by 'coreproject'. You can override using the
#> `.groups` argument.
Session information
sessionInfo()
#> R version 4.3.2 (2023-10-31)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 22.04.3 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0
#>
#> locale:
#> [1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
#> [4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
#> [7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
#> [10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] DT_0.31 grantpubcite_0.0.3 dplyr_1.1.4
#>
#> loaded via a namespace (and not attached):
#> [1] sass_0.4.8 utf8_1.2.4 generics_0.1.3 stringi_1.8.2
#> [5] hms_1.1.3 digest_0.6.33 magrittr_2.0.3 evaluate_0.23
#> [9] fastmap_1.1.1 jsonlite_1.8.8 httr_1.4.7 purrr_1.0.2
#> [13] fansi_1.0.6 crosstalk_1.2.1 textshaping_0.3.7 jquerylib_0.1.4
#> [17] cli_3.6.1 rlang_1.1.2 crayon_1.5.2 ellipsis_0.3.2
#> [21] bit64_4.0.5 withr_2.5.2 cachem_1.0.8 yaml_2.3.7
#> [25] parallel_4.3.2 tools_4.3.2 tzdb_0.4.0 memoise_2.0.1
#> [29] curl_5.2.0 vctrs_0.6.5 rjsoncons_1.0.1 R6_2.5.1
#> [33] lifecycle_1.0.4 stringr_1.5.1 fs_1.6.3 htmlwidgets_1.6.4
#> [37] bit_4.0.5 vroom_1.6.5 ragg_1.2.6 pkgconfig_2.0.3
#> [41] desc_1.4.3 pkgdown_2.0.7 pillar_1.9.0 bslib_0.6.1
#> [45] glue_1.6.2 systemfonts_1.0.5 xfun_0.41 tibble_3.2.1
#> [49] tidyselect_1.2.0 knitr_1.45 htmltools_0.5.7 rmarkdown_2.25
#> [53] readr_2.1.4 compiler_4.3.2