Matthew Lincoln, PhD Art History and Digital Research

clipr: cross-platform access to the clipboard

Oddly enough, base R only includes clipboard interaction functions for Windows. But with a little bit of calling to the command line, we can solve that issue for OS X and Linux.

I’m pleased as punch to introduce my very first R package on CRAN: clipr, a micropackage with two simple utility functions to read and write from your system clipboard, whether you’re running on OS X, Linux, or Windows:

library("clipr")

var <- read_clip()

write_clip(c("Text", "for", "clipboard"), sep = "\n")

Cite this post:

Lincoln, Matthew D. "clipr: cross-platform access to the clipboard." Matthew Lincoln, PhD (blog), 02 Sep 2015, http://matthewlincoln.net/2015/09/02/clipr-cross-platform-access-to-the-clipboard.html.


Tagged in: R