R/clipr_addin.R

Defines functions clipr_output clipr_result

clipr_result <- function() {
  context <- rstudioapi::getActiveDocumentContext()
  expr_object <- eval(parse(text = context$selection[[1]]$text))
  write_clip(expr_object)
}

clipr_output <- function() {
  context <- rstudioapi::getActiveDocumentContext()
  expr_object <- eval(parse(text = context$selection[[1]]$text))
  write_clip(utils::capture.output(expr_object))
}

Try the clipr package in your browser

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

clipr documentation built on March 18, 2022, 6:46 p.m.