R/launch_rfair.R

Defines functions launch_rfair

Documented in launch_rfair

#' Launch the rfair Shiny app
#'
#' Opens an interactive app to assess the FAIRness of a research data object and
#' explore the per-metric results, license reusability, access/sensitivity, and
#' identifier hygiene.
#'
#' @param ... Passed to [shiny::runApp()].
#' @return Runs the app (called for its side effect); invisibly `NULL`.
#' @export
#' @examples
#' if (interactive()) {
#'   launch_rfair()
#' }
launch_rfair <- function(...) {
  for (pkg in c("shiny", "bslib", "DT")) {
    if (!requireNamespace(pkg, quietly = TRUE)) {
      stop("Package '", pkg, "' is required to run the rfair app. ",
           "Install it with install.packages(\"", pkg, "\").", call. = FALSE)
    }
  }
  app_dir <- system.file("shiny-apps", "rfair", package = "rfair")
  if (!nzchar(app_dir)) {
    stop("Could not find the bundled Shiny app. Try reinstalling rfair.", call. = FALSE)
  }
  shiny::runApp(app_dir, ...)
}

Try the rfair package in your browser

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

rfair documentation built on July 1, 2026, 5:07 p.m.