R/see.authors.R

Defines functions see.authors

Documented in see.authors

see.authors <- function( results = NULL,search = NULL, index = 'article.titles'){
  if (!is.null(search)){
    if (is.null(results)) stop('result table not provided ')

    indx <- results %>%
      pull(index) %>%
      str_which(search)

    if (is.null(indx)) stop("could not find matching search in index")

    results[indx,] %>%
      pull(article.authors) %>%
      return()
  }
}
ShawnBrad/SearchPubmed documentation built on Jan. 19, 2020, 5:19 p.m.