Skip to content

Instantly share code, notes, and snippets.

@byzheng
byzheng / xlsxToR.r
Last active March 20, 2019 06:54 — forked from schaunwheeler/xlsxToR.r
Thanks @schaunwheeler codes to read xlsx files. I had remove all dependence and parse the xml files with text regular expression. It will be much faster to read large xlsx files.
#' Read xlsx files
#'
#' @param file The path to xlsx file
#' @param keep_sheets A vector of sheet name
#' @param header Whether include the head in the sheet
#' @param empty_row Whether to remove the empty rows
#' @export
xlsxToR <- function(file, keep_sheets = NULL, header = TRUE, empty_row = TRUE)
{
suppressWarnings(file.remove(tempdir()))