dfs2xlsx: Write a list of data frames into an excel file with each data...

Description Usage Arguments Value Examples

View source: R/xlsx2dfs.R

Description

Write a list of data frames into an excel file with each data frame in a new sheet and the list element name as its sheet name.

Usage

1
dfs2xlsx(dfs, fpath, rowNames = TRUE, colNames = TRUE)

Arguments

dfs

A list of data frames (names in the list are the names of the sheets).

fpath

A character string representing path and filename of the output.

rowNames

A boolean indicating whether the first column of a table in every sheet contains row names of the table.

colNames

A boolean indicating whether the first line of a table in every sheet contains a header.

Value

Nothing. Writes out data frames into specified Excel file.

Examples

1
2
3
4
5
df1 <- data.frame(A=c(1, 2), B=c(3, 4))
df2 <- data.frame(C=c(5, 6), D=c(7, 8))
xlsx_fpath <- file.path(tempdir(), "testout.xlsx")
dfs2xlsx(withNames("sheet1", df1, "sheet2", df2), xlsx_fpath)
file.remove(xlsx_fpath)

Example output

Loading required package: openxlsx
[1] TRUE

xlsx2dfs documentation built on Oct. 11, 2019, 5:06 p.m.