Learn R Programming

openxlsx (version 1.0.3)

readWorkbook: Read data from a worksheet into a data.frame

Description

Read data from a worksheet into a data.frame

Usage

readWorkbook(xlsxFile, sheet = 1, startRow = 1, colNames = TRUE)

Arguments

xlsxFile
A xlsx workbook
sheet
The name or index of the sheet to read data from
startRow
startRow is used to specify where to begin looking for data. Empty rows will be skipped regardless of the value of startRow.
colNames
IF TRUE, will attempt to look for column names.

Value

  • data.frame

Details

Creates a data.frame of all data in worksheet. If the first row of data consists entirely of strings, these will be used as column names.

See Also

read.xlsx

Examples

Run this code
xlsxFile <- system.file("readTest.xlsx", package = "openxlsx")
df1 <- readWorkbook(xlsxFile = xlsxFile, sheet = 1)

Run the code above in your browser using DataLab