R/open_help.R

Defines functions open_help

Documented in open_help

#' @title Opens a Manual Page
#'
#' @description
#' Simply opens a manual page specified in "package::topic" syntax.
#'
#' @param man (`character(1)`)\cr
#'   Manual page to open in "package::topic" syntax.
#' @return Nothing.
#' @export
open_help = function(man) {
  if (!test_string(man)) {
    message("No help available")
    return(invisible())
  }

  parts = strsplit(man, split = "::", fixed = TRUE)[[1L]]
  match.fun("help")(parts[2L], parts[1L])
}

Try the mlr3misc package in your browser

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

mlr3misc documentation built on Sept. 20, 2023, 5:06 p.m.