Skip to content

Instantly share code, notes, and snippets.

@njahn82
Last active June 17, 2019 15:00
Show Gist options
  • Select an option

  • Save njahn82/3c6a0d0324ad052bd7af577b89d864d6 to your computer and use it in GitHub Desktop.

Select an option

Save njahn82/3c6a0d0324ad052bd7af577b89d864d6 to your computer and use it in GitHub Desktop.
library(tidyverse)
library(rcrossref)
library(roadoi)

Load data

table_2 <- readr::read_csv("199_with_valid_non_duplicated_DOI_WOS_missing_from_Unpaywall_Crossref.csv")

Check, which registration agency minted the DOI

cr_agency <- purrr::map(table_2$DOI, rcrossref::cr_agency)
cr_agency_df <- tibble(doi = purrr::map_chr(cr_agency, c("DOI")),
       agency = purrr::map_df(cr_agency, c("agency"))
       ) 
cr_agency_df <- tibble(doi = cr_agency_df$doi, 
                       doi_agency_id = cr_agency_df$agency$id, 
                       doi_agency_label = cr_agency_df$agency$label)
cr_agency_df %>%
  count(doi_agency_label)
#> # A tibble: 2 x 2
#>   doi_agency_label     n
#>   <chr>            <int>
#> 1 Crossref           195
#> 2 KISTI                4

Check Crossref-registered DOIs if the publisher provided metadata to Crossref

cr_works_df <- cr_agency_df %>%
  filter(doi_agency_label == "Crossref") %>%
  .$doi %>%
  rcrossref::cr_works()
cr_works_df$data %>% 
  filter(!is.na(doi))
#> # A tibble: 195 x 34
#>    alternative.id container.title created deposited published.online doi  
#>    <chr>          <chr>           <chr>   <chr>     <chr>            <chr>
#>  1 su8040325      Sustainability  2016-0… 2018-03-… 2016-03-31       10.3…
#>  2 <NA>           Journal of Env… 2011-0… 2019-06-… <NA>             10.3…
#>  3 <NA>           World Journal … 2017-1… 2017-11-… <NA>             10.4…
#>  4 <NA>           Rendiconti Lin… 2011-0… 2018-03-… <NA>             10.4…
#>  5 <NA>           Folia Phoniatr… 2017-0… 2017-10-… 2017-06-29       10.1…
#>  6 <NA>           Current Issues… 2018-0… 2018-10-… <NA>             10.1…
#>  7 10.3892/ol.20… Oncology Lette… 2016-0… 2018-01-… 2016-04-28       10.3…
#>  8 <NA>           Dental Materia… 2016-0… 2017-06-… <NA>             10.4…
#>  9 <NA>           Annals of Math… 2011-0… 2019-06-… 2011-07-01       10.4…
#> 10 <NA>           Türkiye Fiziks… 2018-0… 2018-02-… 2016-12-19       10.5…
#> # … with 185 more rows, and 28 more variables: indexed <chr>, issn <chr>,
#> #   issue <chr>, issued <chr>, member <chr>, page <chr>, prefix <chr>,
#> #   publisher <chr>, reference.count <chr>, score <chr>, source <chr>,
#> #   title <chr>, type <chr>, url <chr>, volume <chr>, author <list>,
#> #   link <list>, license <list>, reference <list>, published.print <chr>,
#> #   subject <chr>, update.policy <chr>, abstract <chr>, assertion <list>,
#> #   archive <chr>, subtitle <chr>, isbn <chr>, funder <list>

Check Unpaywall

upywall <- cr_agency_df %>%
  filter(doi_agency_label == "Crossref") %>%
  .$doi %>%
  roadoi::oadoi_fetch(email = "najko.jahn@gmail.com")
upywall
#> # A tibble: 195 x 16
#>    doi   best_oa_location oa_locations data_standard is_oa genre
#>    <chr> <list>           <list>               <int> <lgl> <chr>
#>  1 10.3… <tibble [1 × 9]> <tibble [3 …             2 TRUE  jour…
#>  2 10.3… <tibble [0 × 0]> <tibble [0 …             2 FALSE jour…
#>  3 10.4… <tibble [1 × 11… <tibble [2 …             2 TRUE  jour…
#>  4 10.4… <tibble [1 × 8]> <tibble [1 …             2 TRUE  jour…
#>  5 10.1… <tibble [0 × 0]> <tibble [0 …             2 FALSE jour…
#>  6 10.1… <tibble [1 × 9]> <tibble [2 …             2 TRUE  jour…
#>  7 10.3… <tibble [1 × 8]> <tibble [3 …             2 TRUE  jour…
#>  8 10.4… <tibble [1 × 8]> <tibble [1 …             2 TRUE  jour…
#>  9 10.4… <tibble [1 × 8]> <tibble [3 …             2 TRUE  jour…
#> 10 10.5… <tibble [1 × 7]> <tibble [1 …             2 TRUE  jour…
#> # … with 185 more rows, and 10 more variables: journal_is_oa <lgl>,
#> #   journal_is_in_doaj <lgl>, journal_issns <chr>, journal_name <chr>,
#> #   publisher <chr>, title <chr>, year <chr>, updated <chr>,
#> #   non_compliant <list>, authors <list>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment