write_xlsx {writexl}R Documentation

Export to xlsx

Description

Writes a data frame to an xlsx file. To create an xlsx with (multiple) named sheets, simply set x to a named list of data frames.

Usage

write_xlsx(x, path = tempfile(fileext = ".xlsx"), col_names = TRUE)

Arguments

x

data frame or named list of data frames that will be sheets in the xlsx

path

a file name to write to

col_names

write column names at the top of the file?

Details

Currently supports strings, numbers, booleans and dates. Formatting options may be added in future versions.

Examples

# Roundtrip example
tmp <- write_xlsx(iris)
readxl::read_xlsx(tmp)

[Package writexl version 1.0 Index]