R/xclip.R

Defines functions xclip

Documented in xclip

#' @title Remove additional spaces/paragraphs from clipboard text
#' @description This function removes any additional whitespace or paragraphs from copied text (clipboard)
#' in a single block of text, adding it to the clipboard OS
#'
#' @return Single block text in the clipboard.
#' @export
#'
#' @author CainĂ£ Max Couto-Silva

xclip <- function(){
  x <- tm::stripWhitespace(clipr::read_clip())
  x <- paste(x, collapse = " ")
  clipr::write_clip(x)
}
cmcouto-silva/gt documentation built on June 6, 2021, 7:14 p.m.