copyToExcel: Copy data from R to Excel via the clipboard

Description Usage Arguments Details Value Warning Author(s) See Also Examples

View source: R/copyToExcel.r

Description

A fast way to transfer small amounts of data from R to Excel.

Usage

1
copyToExcel(x, rowheader = TRUE, header = TRUE, na = "", ...)

Arguments

x

name of R object to write out

rowheader

did you want to write out the row header(s)/name(s) too?

header

did you want to write out the column header(s) too?

na

the string to use for missing values in the data

...

arguments to be passed to other methods

Details

Call this function with your data as the x argument and its values will be written to the clipboard. In Excel, "paste" into the location whose upper left corner is your cursor's position. Be careful where you paste because contents will be overwritten and there is no "undo"!

This is a wrapper for R's write.table function that standardizes the argument list throughout the excelRio package. It also calls write.table with the appropriate value for file depending on the two supported operating systems: Windows and Debian.

The default behavior for argument na changes the default behavior of write.table so that NA values show as white space in Excel rather than as "NA".

Value

NULL

Warning

Contents will be overwritten and there is no "undo"!

Author(s)

dmm

See Also

pasteFromExcel, writeToExcel, writeToCsv

Examples

1
2
3
4
5
loss <- 100 * (1:5)
names(loss) <- LETTERS[1:5]
### NOT RUN
# copyToExcel(loss) # Saves the data to the clipboard.
# In Excel "paste" the data where you want it.

trinostics/excelRio documentation built on June 18, 2020, 4:41 p.m.