R/open_pubmed.R

#' function to go to pubmed page
#'
#' Will take a vector of PMIDs upto 10.
#'
#' @param PMID pubmed ID
#'
#' @return opens webpages
#' @export
#'
#' @examples
#' PMID  <- unique(biomarkers$`STUDY (PMID)`)[1:5]
#' open_pubmed(PMID)
open_pubmed  <- function(PMID){
  if(length(PMID) > 10){
    stop("We have limited the number of PMIDs to 10.")
  }
  for(i in PMID){
    url  <- stringr::str_c("https://www.ncbi.nlm.nih.gov/pubmed/", i)
    browseURL(url)
  }
}
jonotuke/painBiomarkR documentation built on May 13, 2019, 3:01 a.m.