xlsx.readFile: Read the contents of a worksheet into an R data.frame

Description Usage Arguments Author(s) References Examples

View source: R/r2excel.r

Description

Read the contents of a worksheet into an R data.frame. This function is just a wrapper for the read.xlsx2 function from xlsx package.

Usage

1
xlsx.readFile(file, sheetIndex = 1, startRow = 1, colIndex = NULL, endRow = NULL, header = TRUE, ...)

Arguments

file

the path to the file to read

sheetIndex

a number indicating the index of the sheet to read from the workbook

startRow

a numeric value specifying the starting row

colIndex

a numeric vector indicating the cols you want to extract. If NULL, all columns found will be extracted.

endRow

a number specifying the index of the last row to pull. If NULL, read all the rows in the sheet.

header

a logical value indicating whether the first row corresponding to the first element of the rowIndex vector contains the names of the variables.

...

other arguments to read.xlsx2 function

Author(s)

Alboukadel Kassambara <alboukadel.kassambara@gmail.com>

References

http://www.sthda.com

Examples

1
2
3
file <- system.file("tests", "test_import.xlsx", package = "xlsx")
res <- xlsx.readFile(file, 1)  # read first sheet
head(res)

kassambara/r2excel documentation built on May 20, 2019, 7:40 a.m.