write_clip: Write clipboard
Write a character vector to the system clipboard
An object to be written to the system clipboard.
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
write.table for pasting into an external spreasheet program.
It will otherwise coerce the object to a character vector.
check the object type, otherwise
character can be
The separator to be used between each element of the character
vector being written.
NULL defaults to writing system-specific line
breaks between each element of a character vector, or each row of a table.
The terminator to be written after each string, followed by an
nul. Defaults to no terminator character, indicated by
If true, returns the rendered string; if false, returns the
Custom options to be passed to
write.table (if the
object is a table-like) Defaults to sane line-break and tab standards based
on the operating system.
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
## Not run:
text <- "Write to clipboard"
multiline <- c("Write", "to", "clipboard")
write_clip(multiline, breaks = ",")
tbl <- data.frame(a=c(1,2,3), b=c(4,5,6))
## End(Not run)