R/open_in_nci_thesaurus.R

Defines functions open_in_nci_thesaurus

Documented in open_in_nci_thesaurus

#' Browse the NCIt
#'
#' Opens the web browser at NCI Thesaurus for the entries provided as NCI codes.
#'
#' @param nci_code A character vector of NCI codes.
#'
#' @return Run for its side effect.
#'
#' @examples
#' \dontrun{
#' open_in_nci_thesaurus('C3107')
#' }
#' @export
open_in_nci_thesaurus <- function(nci_code) {

  if (interactive()) {
    urls <-
      glue::glue("https://ncit.nci.nih.gov/ncitbrowser/ConceptReport.jsp?dictionary=NCI_Thesaurus&ns=ncit&code={nci_code}")

    purrr::walk(urls, utils::browseURL)

    return(invisible(TRUE))
  } else {
    return(invisible(TRUE))
  }

}

Try the mskcc.oncotree package in your browser

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

mskcc.oncotree documentation built on Oct. 12, 2022, 1:06 a.m.