R/get.authors.R

Defines functions get.authors

# function to gather all authors for an article
#into a tibble with last name,
#first name and initials

get.authors <- function(article){
  # takes as inbut a single xml_node set corresponding to an article
out<- xml_nodes(article, xpath =  './/AuthorList/Author') %>%
  map_dfr( .f = get.name.info)

if (is.null(out)) out = 'NA'
  return(out)

}
ShawnBrad/SearchPubmed documentation built on Jan. 19, 2020, 5:19 p.m.