R/get_PM_dates.R

#' Takes a list of PMIDs and return a data frame with year and month
#'
#' @param PMIDs vector of PMIDs
#'
#' @return data frame
#' @export
#'
#' @examples
#' library(painBiomarkR)
#' data(papers)
#' get_PM_dates(papers$`Study PMID`[1:10])
get_PM_dates  <- function(PMIDs){
  months  <- c("JAN", "FEB", "MAR", "APR", "MAY",
               "JUN", "JUL", "AUG", "SEP", "OCT",
               "NOV", "DEC")
  papers  <- EUtilsGet(PMIDs)
  df  <- data_frame(
    PMID = PMID(papers),
    Month = months[MonthPubmed(papers)],
    Year = YearPubmed(papers))
  return(df)
}
jonotuke/painBiomarkR documentation built on May 13, 2019, 3:01 a.m.