ropensci / openalexR

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

Empty institution lineage #158

Closed yjunechoe closed 1 year ago

yjunechoe commented 1 year ago

Following #155, this PR ensures that missing author "lineage" information is coded as NA and applies the same fix for works2df() to authors2df().

Related: #154 , #156 , #157

Coincidentally, fixing authors2df() also resolved the last remaining error in tests involving oa_random(), where the following line was sometimes returning dfs longer than 20 rows because multiple lineages would get unnested longer into duplicate entries of the author in authors2df().

https://github.com/ropensci/openalexR/blob/ab6554d36e4fa1ff0206ee95d69289e2afa19821/tests/testthat/test-oa_fetch.R#L291

yjunechoe commented 1 year ago

Oh wait I think you did with empty_inst

Oops ya that wasn't very clear/intuitive - re-running the reprex on the PR!

oa_fetch(identifier = "W1981492994")$author[[1]]$institution_lineage
#> [1] NA                               "https://openalex.org/I51556381"
yjunechoe commented 1 year ago

Pinging @massimoaria - all checks are passing on main with this PR merged, so I think we have a resubmission version ready!