R/get_study_desc.R

Defines functions get_study_desc

Documented in get_study_desc

#' Get Study Description
#'
#' Retrieve the abstract based description of a public study
#'
#' @param study_id A character string of a valid MTBLS study id
#' @return a character string of the study description
#' @export
#' @examples
#' get_study_desc('MTBLS375')

get_study_desc <- function(study_id)
{
  study_desc <-
    httr::GET(
      paste0(getOption('BASE_URL'),
             '/studies/',
             study_id,
             '/description')
    )


  study_desc_parse <- study_desc %>% httr::content('parsed')

  return(study_desc_parse$description)

}

Try the metabolighteR package in your browser

Any scripts or data that you put into this service are public.

metabolighteR documentation built on Feb. 10, 2022, 1:09 a.m.