R/clipboard.R

Defines functions read_clipboard

#' @keywords internal
#' @noRd
read_clipboard <- function() {
  if (!requireNamespace("clipr", quietly = TRUE)) {
    stop("Reading the clipboard needs the 'clipr' package. ",
         "Install it, or pass `code`/`file`.", call. = FALSE)
  }
  if (!clipr::clipr_available()) {
    stop("No clipboard available (headless session?). Pass `code`/`file`.",
         call. = FALSE)
  }
  clipr::read_clip()
}

Try the minex package in your browser

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

minex documentation built on Aug. 30, 2026, 1:07 a.m.