Skip to content

Commit

Permalink
Work around bug on blank cells with comment (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bisaloo committed Oct 22, 2023
1 parent 30f6a8b commit 39bf025
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# xlcutter (development version)

* `xlsx_cutter()` no longer fails when reading excel files with comments on
blank cells (#14, @Bisaloo).

# xlcutter 0.1.0

* Added a `NEWS.md` file to track changes to the package.
8 changes: 6 additions & 2 deletions R/xlsx_cutter.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@ single_xlsx_cutter <- function(

d <- tidyxl::xlsx_cells(
data_file,
sheets = data_sheet,
include_blank_cells = FALSE
sheets = data_sheet
)
# FIXME: this is not ideal because we'd rather not read blank cells at all
# by setting `include_blank_cells = FALSE` in `tidyxl::xlsx_cells()`. But
# this is currently failing in the case where we have blank cells with
# comments: https://github.com/nacnudus/tidyxl/issues/91
d <- d[!d$is_blank, ]

d <- merge(coords, d, all = FALSE, all.x = TRUE)
d <- d[order(d$row, d$col), ]
Expand Down

0 comments on commit 39bf025

Please sign in to comment.