Copy any R output to clipboard
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’!