Skip to content

Commit

Permalink
handle infinite sheet number
Browse files Browse the repository at this point in the history
  • Loading branch information
DanChaltiel committed Mar 11, 2024
1 parent 90f77c3 commit d081c12
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/read_excel.R
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ standardise_sheet <- function(sheet, range, sheet_names) {

if (is.numeric(sheet)) {
if (sheet < 1) {
if(is.infinite(sheet)) sheet <- -length(sheet_names)
length(sheet_names) + sheet
} else {
if(is.infinite(sheet)) sheet <- length(sheet_names)
floor(sheet) - 1L
}
} else if (is.character(sheet)) {
Expand Down

0 comments on commit d081c12

Please sign in to comment.