njahn82 / semscholar

R interface to Semantic Scholar API
Other
16 stars 4 forks source link

s2_papers breaks when no author data is available #3

Open njahn82 opened 3 years ago

njahn82 commented 3 years ago

reported via mail, seems also be the reason for #1

njahn82 commented 3 years ago
library(semscholar)
my_dois <- c("10.1001/amajethics.2018.699",
             "10.1001/jama.2013.279671",
             "10.1001/jama.2013.285157",
             "10.1001/jama.2014.11888",
             "10.1001/jama.2014.14604",
             "10.1001/jama.2014.16588",
             "10.1001/jama.2014.2104",
             "10.1001/jama.2014.306",
             "10.1001/jama.2014.6421",
             "10.1001/jama.2014.7667",
             "10.1001/jama.2014.9007",
             "10.1001/jama.2015.17103")
my_s2_df <- s2_papers(my_dois)
#> Request failed [404]. Retrying in 1.2 seconds...
#> Request failed [404]. Retrying in 1.2 seconds...
#> Warning: Paper with ID 10.1001/jama.2014.16588 was not found
my_s2_df
#> # A tibble: 11 x 14
#>    abstract   arxiv_id authors citation_veloci… citations doi   influential_cit…
#>    <chr>      <chr>    <list>             <int> <list>    <chr>            <int>
#>  1 "Although… <NA>     <tibbl…                0 <tibble … 10.1…                0
#>  2 "T he Bea… <NA>     <tibbl…                0 <tibble … 10.1…                0
#>  3 "We belie… <NA>     <tibbl…                0 <tibble … 10.1…                0
#>  4  <NA>      <NA>     <tibbl…                0 <tibble … 10.1…                0
#>  5 "IMPORTAN… <NA>     <tibbl…              112 <tibble … 10.1…               20
#>  6 "The revi… <NA>     <tibbl…                0 <tibble … 10.1…                1
#>  7 "A health… <NA>     <tibbl…                0 <tibble … 10.1…                0
#>  8 "Another … <NA>     <tibbl…                0 <tibble … 10.1…                0
#>  9 "In Reply… <NA>     <tibbl…                0 <tibble … 10.1…                0
#> 10 "In Reply… <NA>     <tibbl…                0 <tibble … 10.1…                0
#> 11 "Here on … <NA>     <tibbl…                0 <tibble … 10.1…                0
#> # … with 7 more variables: paper_id <chr>, references <list>, title <chr>,
#> #   topics <list>, url <chr>, venue <chr>, year <int>

Created on 2021-06-22 by the reprex package (v2.0.0)

njahn82 commented 3 years ago

Should be fixed now.