file <- system.file("tests", "test_import.xlsx", package = "xlsx")
wb <- loadWorkbook(file)
sheets <- getSheets(wb)
sheet <- sheets[[2]] # get second sheet
rows <- getRows(sheet) # get all the rows
cells <- getCells(rows) # returns all non empty cells
values <- lapply(cells, getCellValue) # extract the values
Run the code above in your browser using DataLab