toclipboard | R Documentation |
A data frame of variable is written to the clipboard, allowing easy pasting to MS Excel and Open/Libre Office Calc. This function is a wrapper to write.table
with pre-specified options for plug-and-play usage. Most options of write.table
are also supported by toclipboard
. Note: The current version of toclipboard
only supports Windows systems; the function will not run under Linux or Mac OS.
toclipboard(data, sep = "\t", quote = FALSE, eol = "\n", na = "NA", dec = ".", row.names = FALSE, col.names = TRUE, clipwarning = FALSE)
data |
The first argument should be the data frame or variable that is to be written to the clipboard. Data frames are copied with column names but without row names and columns are separated by tabs. This behavior can be customized with the following optional arguments (passed to |
sep |
Delimiter string. |
quote |
Put quotes around strings? |
eol |
End-of-line character. |
na |
How should NA-values be written? |
dec |
Decimal separator. |
row.names |
Should row names be written? |
col.names |
Should column names be written? |
clipwarning |
Determine if warnings should overwrite clipboard content (especially in case of buffer overflow when attempting to copy large datasets to the clipboard. |
Roland Pfister
write.table
## Build data frame var1 <- c(1:9) var2 <- c(1,1,1,2,2,2,3,3,3) tmpdata <- data.frame(cbind(var1,var2)) ## Write data frame to clipboard toclipboard(tmpdata) ## -> The data frame can now be pasted ## into any other application.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.