write_excel: Write R data into excel

Description Usage Arguments Value Examples

View source: R/write_excel.R

Description

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)

Usage

1
write_excel(x, row.names = FALSE, col.names = TRUE, ...)

Arguments

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

Value

data.frame copied to clipboard

Examples

 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_excel(data)

# now paste data into a spreadsheet (i.e. open a spreadsheet and press ctrl + v)

DanielGardiner/HelperFunc documentation built on May 23, 2019, 2:42 p.m.