ez.readxlist: read all sheets in an xlsx file, optionally prints sheet...

View source: R/io.R

ez.readxlistR Documentation

read all sheets in an xlsx file, optionally prints sheet names, same syntax as ez.readx, wrapper of getSheetNames from the openxlsx package

Description

read all sheets in an xlsx file, optionally prints sheet names, same syntax as ez.readx, wrapper of getSheetNames from the openxlsx package

Usage

ez.readxlist(
  file,
  print2scr = TRUE,
  tolower = FALSE,
  stringsAsFactors = FALSE,
  blanksAsNA = TRUE,
  na.strings = c("", "."),
  makenames = TRUE,
  ...
)

Arguments

print2scr

print out sheet indices and names, default TRUE

tolower

whether to convert all column names to lower case

stringsAsFactors

T/F

blanksAsNA

T/F, converts factor or character vector elements to NA if matching na.strings

na.strings

only applicable if blanksAsNA=T. e.g., c(”,'.','NA','na','N/A','n/a','NaN','nan')

makenames

if F, keep as is. if T, call make.names(unique=TRUE,allow_=TRUE) _ kept, The character "X" is prepended if necessary. All invalid characters are translated to "." .1 .2 etc appended for uniqueness

Value

a list of sheet as data frame. To get sheetnames, names(result)
when stringsAsFactors=T, in the returned data frame, string to factor
number stored as text in excel (->string) -> factor

Examples

readxlist(file, sheet = 1, startRow = 1, colNames = TRUE,
         rowNames = FALSE, detectDates = FALSE, skipEmptyRows = TRUE,
         rows = NULL, cols = NULL, check.names = FALSE, namedRegion = NULL)

jerryzhujian9/ezmisc documentation built on March 9, 2024, 12:44 a.m.