ropensci / openalexR

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

error using oa_fetch #250

Closed milliken closed 4 months ago

milliken commented 4 months ago

I'm trying to pull results from a list of pmids using oa_fetch and I see results for downloading the expected number of results but then the script stops with the error message below. It worked fine a couple weeks ago.

Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, : arguments imply differing number of rows: 1, 0

My code: works_from_pmids <- oa_fetch( pmid = c("34706856","36517336","33796993","28575484","27641738","32207354","32043304","33031349","34983646","28980166","31910992","35289741","34342620","35922522","35165819","30570162","34467386","35288599","34940862","35880872","34293255","33983076","35473409","32740180","32928049","37101281","34883088","32867803","34358831","33772433","38167280","33692177","36174092","35987681","33157007","32730233","33328527","34610185","34610185","36322431","35350919","32134129","35190503","31735564","32740192","33745587","38374568","33566465","33372745","37678381","37344303","31162372","30707210","32653571","38038620","34820856","36648469","36528052","35093318","36517932","37125809","37735443","36988337","36847979","36318499","37904390","32085844","33632940","32777193","29566462","32645767","33843971","38269418","36342116","32546247","33172557","35614518","30087153","38031116","30760183","30362989","30675002","34047722","31488402","38011103","33893213","34505720","34376358","33020101","34271122","36037984","32324238","36915106","38217267","29428917","37230011","33787584","29641221","36892305","29544449","31139182","35332737","33665769","33450335","33885041","37211894","31309235","32768465","33269487","32817266","29601846","29370008","32639470","38240536","36084912","34882826","37406760","33049119","36516197","32088913","32959409","36066264","37580663","36728954","36734732","34538125","33764654","38048787","38172296","32063157","36534387","35320502","33612484","35390113","33865494","36929864","30067578","36834194","35029869","35101098","36071424","37272969","33181730","37294145","34705168","29476389","29176465","30900268","35759691","38240537","34052092","33612485","33326335","35984380","35135715","37122050","31821429","31577692","32201198","34110580","35587212","31274778","35831900","30879734","29335014","35549984","37478810","37728917","36219978","35522534","32198861","37733115","31187518","38149388","32485124","35804409","31898531","30921401","36843346","30773722","34053490","33705273","35811277"), entity = "works", from_publication_date = "2018-01-01", to_publication_date = "2024-04-15", verbose = TRUE )



Any idea what I can do to fix this?
trangdata commented 4 months ago

@milliken Could you try to reinstall to the latest version? 🙏🏽

library(openalexR)
packageVersion("openalexR")
#> [1] '1.3.1'
works_from_pmids <- oa_fetch(
  pmid = c("34706856","36517336","33796993","28575484","27641738","32207354","32043304","33031349","34983646","28980166","31910992","35289741","34342620","35922522","35165819","30570162","34467386","35288599","34940862","35880872","34293255","33983076","35473409","32740180","32928049","37101281","34883088","32867803","34358831","33772433","38167280","33692177","36174092","35987681","33157007","32730233","33328527","34610185","34610185","36322431","35350919","32134129","35190503","31735564","32740192","33745587","38374568","33566465","33372745","37678381","37344303","31162372","30707210","32653571","38038620","34820856","36648469","36528052","35093318","36517932","37125809","37735443","36988337","36847979","36318499","37904390","32085844","33632940","32777193","29566462","32645767","33843971","38269418","36342116","32546247","33172557","35614518","30087153","38031116","30760183","30362989","30675002","34047722","31488402","38011103","33893213","34505720","34376358","33020101","34271122","36037984","32324238","36915106","38217267","29428917","37230011","33787584","29641221","36892305","29544449","31139182","35332737","33665769","33450335","33885041","37211894","31309235","32768465","33269487","32817266","29601846","29370008","32639470","38240536","36084912","34882826","37406760","33049119","36516197","32088913","32959409","36066264","37580663","36728954","36734732","34538125","33764654","38048787","38172296","32063157","36534387","35320502","33612484","35390113","33865494","36929864","30067578","36834194","35029869","35101098","36071424","37272969","33181730","37294145","34705168","29476389","29176465","30900268","35759691","38240537","34052092","33612485","33326335","35984380","35135715","37122050","31821429","31577692","32201198","34110580","35587212","31274778","35831900","30879734","29335014","35549984","37478810","37728917","36219978","35522534","32198861","37733115","31187518","38149388","32485124","35804409","31898531","30921401","36843346","30773722","34053490","33705273","35811277"),
  entity = "works",
  from_publication_date = "2018-01-01",
  to_publication_date = "2024-04-15",
  verbose = TRUE
)
#> Requesting url: https://api.openalex.org/works?filter=pmid%3A34706856%7C36517336%7C33796993%7C28575484%7C27641738%7C32207354%7C32043304%7C33031349%7C34983646%7C28980166%7C31910992%7C35289741%7C34342620%7C35922522%7C35165819%7C30570162%7C34467386%7C35288599%7C34940862%7C35880872%7C34293255%7C33983076%7C35473409%7C32740180%7C32928049%7C37101281%7C34883088%7C32867803%7C34358831%7C33772433%7C38167280%7C33692177%7C36174092%7C35987681%7C33157007%7C32730233%7C33328527%7C34610185%7C34610185%7C36322431%7C35350919%7C32134129%7C35190503%7C31735564%7C32740192%7C33745587%7C38374568%7C33566465%7C33372745%7C37678381%2Cfrom_publication_date%3A2018-01-01%2Cto_publication_date%3A2024-04-15
#> Getting 1 page of results with a total of 47 records...
#> Requesting url: https://api.openalex.org/works?filter=pmid%3A37344303%7C31162372%7C30707210%7C32653571%7C38038620%7C34820856%7C36648469%7C36528052%7C35093318%7C36517932%7C37125809%7C37735443%7C36988337%7C36847979%7C36318499%7C37904390%7C32085844%7C33632940%7C32777193%7C29566462%7C32645767%7C33843971%7C38269418%7C36342116%7C32546247%7C33172557%7C35614518%7C30087153%7C38031116%7C30760183%7C30362989%7C30675002%7C34047722%7C31488402%7C38011103%7C33893213%7C34505720%7C34376358%7C33020101%7C34271122%7C36037984%7C32324238%7C36915106%7C38217267%7C29428917%7C37230011%7C33787584%7C29641221%7C36892305%7C29544449%2Cfrom_publication_date%3A2018-01-01%2Cto_publication_date%3A2024-04-15
#> Getting 1 page of results with a total of 49 records...
#> Requesting url: https://api.openalex.org/works?filter=pmid%3A31139182%7C35332737%7C33665769%7C33450335%7C33885041%7C37211894%7C31309235%7C32768465%7C33269487%7C32817266%7C29601846%7C29370008%7C32639470%7C38240536%7C36084912%7C34882826%7C37406760%7C33049119%7C36516197%7C32088913%7C32959409%7C36066264%7C37580663%7C36728954%7C36734732%7C34538125%7C33764654%7C38048787%7C38172296%7C32063157%7C36534387%7C35320502%7C33612484%7C35390113%7C33865494%7C36929864%7C30067578%7C36834194%7C35029869%7C35101098%7C36071424%7C37272969%7C33181730%7C37294145%7C34705168%7C29476389%7C29176465%7C30900268%7C35759691%7C38240537%2Cfrom_publication_date%3A2018-01-01%2Cto_publication_date%3A2024-04-15
#> Getting 1 page of results with a total of 50 records...
#> Warning in oa_request(oa_query(filter = filter_i, multiple_id = multiple_id, : 
#> The following work(s) have truncated lists of authors: W4390571860, W4224327146.
#> Query each work separately by its identifier to get full list of authors.
#> For example:
#>   lapply(c("W4390571860", "W4224327146"), \(x) oa_fetch(identifier = x))
#> Details at https://docs.openalex.org/api-entities/authors/limitations.
#> Requesting url: https://api.openalex.org/works?filter=pmid%3A34052092%7C33612485%7C33326335%7C35984380%7C35135715%7C37122050%7C31821429%7C31577692%7C32201198%7C34110580%7C35587212%7C31274778%7C35831900%7C30879734%7C29335014%7C35549984%7C37478810%7C37728917%7C36219978%7C35522534%7C32198861%7C37733115%7C31187518%7C38149388%7C32485124%7C35804409%7C31898531%7C30921401%7C36843346%7C30773722%7C34053490%7C33705273%7C35811277%2Cfrom_publication_date%3A2018-01-01%2Cto_publication_date%3A2024-04-15
#> Getting 1 page of results with a total of 33 records...
works_from_pmids
#> # A tibble: 179 Ă— 38
#>    id               title display_name author ab    publication_date so    so_id
#>    <chr>            <chr> <chr>        <list> <chr> <chr>            <chr> <chr>
#>  1 https://openale… Mult… Multisystem… <df>   BACK… 2020-10-05       "\u0… http…
#>  2 https://openale… An R… An RCT of R… <df>   The … 2020-11-01       "Ame… http…
#>  3 https://openale… Iden… Identificat… <df>   Prev… 2022-03-01       "\u0… http…
#>  4 https://openale… Effe… Effect of a… <df>   Ther… 2021-08-03       "JAM… http…
#>  5 https://openale… Pare… Parent and … <df>   Rati… 2023-02-01       "Ann… http…
#>  6 https://openale… Sodi… Sodium Bica… <df>   To e… 2022-07-26       "Ped… http…
#>  7 https://openale… The … The Analges… <df>   Obje… 2023-03-01       "Jou… http…
#>  8 https://openale… Surv… Survival Wi… <df>   To a… 2023-09-07       "Ped… http…
#>  9 https://openale… Effe… Effect of w… <df>   Abst… 2020-08-31       "Cri… http…
#> 10 https://openale… Shor… Short-term … <df>   Ambi… 2023-04-26       "Env… http…
#> # â„ą 169 more rows
#> # â„ą 30 more variables: host_organization <chr>, issn_l <chr>, url <chr>,
#> #   pdf_url <chr>, license <chr>, version <chr>, first_page <chr>,
#> #   last_page <chr>, volume <chr>, issue <chr>, is_oa <lgl>,
#> #   is_oa_anywhere <lgl>, oa_status <chr>, oa_url <chr>,
#> #   any_repository_has_fulltext <lgl>, language <chr>, grants <list>,
#> #   cited_by_count <int>, counts_by_year <list>, publication_year <int>, …

Created on 2024-05-16 with reprex v2.1.0

milliken commented 4 months ago

Thanks! That worked!