xlsx2dfs {xlsx2dfs}R Documentation

Read-in Excel file (workbook) as a list of data frames.

Description

Read-in Excel file (workbook) as a list of data frames.

Usage

xlsx2dfs(xlsxPath, rowNames = TRUE, colNames = TRUE, ...)

Arguments

xlsxPath

A path to the Excel file, a character.

rowNames

Whether to read-in row names, a boolean.

colNames

Whether to read-in column names, a boolean.

...

... passed to read.xlsx function in the openxlsx package.

Value

A list of data frames, each representing a sheet in the Excel file (sheet names are list element names).

Examples

# create example file
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)
# read created file
dfs <- xlsx2dfs(xlsx_fpath)
file.remove(xlsx_fpath)

[Package xlsx2dfs version 0.1.0 Index]