ropensci / openalexR

Getting bibliographic records from OpenAlex
https://docs.ropensci.org/openalexR/
Other
93 stars 21 forks source link

Add new argument sample to oa_fetch #82

Closed trangdata closed 1 year ago

trangdata commented 1 year ago

Addresses #81.

TODO:

library(openalexR)
oa_fetch(
  "works",
  has_doi = TRUE,
  type = "journal-article",
  is_paratext = FALSE,
  has_references = FALSE,
  sample = 10,
  verbose = TRUE
)
#> Requesting url: https://api.openalex.org/works?filter=has_doi%3Atrue%2Ctype%3Ajournal-article%2Cis_paratext%3Afalse%2Chas_references%3Afalse&sample=10
#> Getting 1 page of results with a total of 10 records...
#> # A tibble: 10 × 28
#>    id       displ…¹ author ab    publi…² relev…³ so    so_id publi…⁴ issn  url  
#>    <chr>    <chr>   <list> <lgl> <chr>     <dbl> <chr> <chr> <chr>   <lis> <chr>
#>  1 https:/… AIRPOR… <df>   NA    2017-0…    2.56 Afri… http… Wiley-… <chr> <NA> 
#>  2 https:/… Vitami… <df>   NA    2017-1…    2.56 Aktu… http… Thieme… <chr> <NA> 
#>  3 https:/… Applic… <df>   NA    2017-0…    2.56 DESt… http… DEStec… <chr> <NA> 
#>  4 https:/… Implem… <df>   NA    2017-1…    2.56 Inte… http… Scienc… <chr> <NA> 
#>  5 https:/… Buddhi… <df>   NA    2017-0…    2.56 Reli… http… Wiley-… <chr> <NA> 
#>  6 https:/… POTENS… <df>   NA    2017-0…    2.56 Jurn… http… Pusat … <chr> http…
#>  7 https:/… Geothe… <df>   NA    2017-0…    2.56 مجله… http… Armeni… <chr> http…
#>  8 https:/… Korres… <df>   NA    2017-0…    2.56 Nach… http… Wiley-… <chr> <NA> 
#>  9 https:/… STUDY … <df>   NA    2017-1…    2.56 Zeno… http… CERN E… <lgl> http…
#> 10 https:/… A Cert… <df>   NA    2017-0…    2.56 Four… http… Michig… <chr> <NA> 
#> # … with 17 more variables: first_page <chr>, last_page <chr>, volume <chr>,
#> #   issue <chr>, is_oa <lgl>, cited_by_count <int>, counts_by_year <list>,
#> #   publication_year <int>, cited_by_api_url <chr>, ids <list>, doi <chr>,
#> #   type <chr>, referenced_works <lgl>, related_works <list>,
#> #   is_paratext <lgl>, is_retracted <lgl>, concepts <list>, and abbreviated
#> #   variable names ¹​display_name, ²​publication_date, ³​relevance_score,
#> #   ⁴​publisher

Created on 2023-02-28 with reprex v2.0.2