ropensci / rentrez

talk with NCBI entrez using R
https://docs.ropensci.org/rentrez
Other
195 stars 38 forks source link

Cleanly extract urls from links #56

Closed dwinter closed 9 years ago

dwinter commented 9 years ago

Working with the prlinks command for entrez_link in #55 made it clear that the object returned by these links functions can be a little cumbersome. They return a nested list that might include empty elements (for missing data). I imagine most users will only want to extract urls from these objects, so a simple function that does just that would be helpful.

I imagine the workflow would go something like this

links <- entrez_link(dbfrom="pubmed", id = recent_search$ids, cmd="prlinks"
urls <- sapply(links$linkouts, extract_url)

And will return NA for missing data and a character string for good urls