write_to_xlsx: Write content to an Excel workbook

Description Usage Arguments Value Examples

View source: R/write_to_xlsx.R

Description

Write content to an Excel workbook

Usage

1
write_to_xlsx(x, wb_name = NULL, open_wb = TRUE)

Arguments

x

An R object or list of R objects

wb_name

(Optional) The name of the workbook to be created (e.g. 'output.xlsx' or 'output/results.xlsx'). If no value is specified, a new workbook is created in the working directory.

open_wb

Whether to open the workbook using Excel once it's been created

Value

Creates an Excel workbook at the path provided by 'wb_name' or as a new file in the working directory. If 'open_wb = TRUE', the workbook will be opened in Excel if possible.

Examples

1
2
3
4
5
6
7
df_list <- list('iris' = iris, mtcars, 'Arrests' = USArrests)

# With a specified output path
write_to_xlsx(df_list, wb_name = "output/r-default-datasets.xlsx")

# With an automatically-generated output path
write_to_xlsx(df_list)

bschneidr/schneidr documentation built on Dec. 25, 2021, 4:55 p.m.