write_clip {clipr} | R Documentation |
Write a character vector to the system clipboard
write_clip(content, object_type = c("auto", "character", "table"), breaks = NULL, eos = NULL, return_new = TRUE, ...)
content |
An object to be written to the system clipboard. |
object_type |
write_clip() tries to be smart about writing objects in a
useful manner. If passed a data.frame or matrix, it will format it using
|
breaks |
The separator to be used between each element of the character
vector being written. |
eos |
The terminator to be written after each string, followed by an
ASCII |
return_new |
If true, returns the rendered string; if false, returns the original object |
... |
Custom options to be passed to |
Invisibly returns the original object
On X11 systems, write_clip
will cause either xclip (preferred)
or xsel to be called. Be aware that, by design, these processes will fork
into the background until the next paste event, when they will then exit
silently.
## Not run: text <- "Write to clipboard" write_clip(text) multiline <- c("Write", "to", "clipboard") write_clip(multiline) # Write # to # clipboard write_clip(multiline, breaks = ",") # write,to,clipboard tbl <- data.frame(a=c(1,2,3), b=c(4,5,6)) write_clip(tbl) ## End(Not run)