R/get.article.types.R

Defines functions get.article.types

get.article.types <- function(article){
  # input is article xml_node set, will return comma
  #separated lists of article types
 out <-  xml_nodes(article,xpath =  './/PublicationTypeList/PublicationType') %>%
    xml_text() %>%
    str_flatten(collapse =  ',') 
 
 if (is.null(out)) (out =='NA')
    return(out)
}
ShawnBrad/SearchPubmed documentation built on Jan. 19, 2020, 5:19 p.m.