Copy any R output to clipboard

infoart.ca
Feb 7, 2022

The ‘clipr’ package fascinates those who are unfascinated by R’s poor capacity to transfer outputs to text editors/clipboard.

library(clipr)

& make whatever text related fun you want to have:

text <- "& make whatever text related fun you want to have:"write_clip(text)

To split into several blocks:

text <- c('& make', 'whatever text', 'related fun you', 'want to have:')write_clip(text)

And of course, there is an option for placing a customizable separator:

text <- c('& make', 'whatever text', 'related fun you', 'want to have:')write_clip(text, breaks = ";")

This applies to copying datasets as well:

Enjoy ‘clipr’!

--

--

infoart.ca

Center for Social Capital & Environmental Research | Posts by Bishwajit Ghose, lecturer at the University of Ottawa