The two arguments to the read.xlsx method that match sheet are sheetIndex and sheetName , according to the signature:
read.xlsx(file, sheetIndex, sheetName=NULL, rowIndex=NULL, startRow=NULL, endRow=NULL, colIndex=NULL, as.data.frame=TRUE, header=TRUE, colClasses=NA, keepFormulas=FALSE, encoding="unknown", ...)
You need a sheetIndex argument:
df =read.xlsx("data.csv",sheetIndex=3, colNames = TRUE)
source share