Description Usage Arguments Value Examples
View source: R/write_to_clipboard.R
A function to easily copy data out of R into a spreadsheet. This should not be used within a reproducible work flow, instead it should only be used on an ad-hoc basis (note: I'm not aware of the original author of this function, it was taken directly from a stack overflow answer)
1  | write_to_clipboard(x, row.names = FALSE, col.names = TRUE, ...)
 | 
x | 
 a data.frame to be copied to clipboard  | 
row.names | 
 a logical indicating if row names should be included  | 
col.names | 
 a logical indicating if column names should be included  | 
... | 
 other read.table options  | 
data.frame copied to clipboard
1 2 3 4 5 6 7 8 9 10 11 12  | # set dummy data
set.seed(2)
data = data.frame(date = sample(seq(as.Date("2017-03-01"), as.Date("2017-08-01"), 1), 20, replace = TRUE),
                  sex = sample(c("Female", "Male"), 20, replace = TRUE))
# apply function to write data to clipboard
write_to_clipboard(data)
# now paste data into a spreadsheet (i.e. open a spreadsheet and press ctrl + v)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.