nacnudus / tidyxl

Read untidy Excel files in R https://nacnudus.github.io/tidyxl/
https://nacnudus.github.io/tidyxl/
Other
248 stars 21 forks source link

Cells incorrectly identified as blank #92

Closed lymanmark closed 9 months ago

lymanmark commented 9 months ago

When reading in the following file there are many cells with is_blank incorrectly set to TRUE. The main consequence for me is that character_formatted is also set to NULL in this instance, and I cannot properly handle superscript characters in the cells.

test.xlsx

tidyxl::xlsx_cells("test.xlsx") |>
  dplyr::filter(data_type == "character", is_blank)
#> # A tibble: 198 × 24
#>    sheet address   row   col is_blank content data_type error logical numeric
#>    <chr> <chr>   <int> <int> <lgl>    <chr>   <chr>     <chr> <lgl>     <dbl>
#>  1 Table K4          4    11 TRUE     <NA>    character <NA>  NA           NA
#>  2 Table M4          4    13 TRUE     <NA>    character <NA>  NA           NA
#>  3 Table N4          4    14 TRUE     <NA>    character <NA>  NA           NA
#>  4 Table O4          4    15 TRUE     <NA>    character <NA>  NA           NA
#>  5 Table P4          4    16 TRUE     <NA>    character <NA>  NA           NA
#>  6 Table Q4          4    17 TRUE     <NA>    character <NA>  NA           NA
#>  7 Table R4          4    18 TRUE     <NA>    character <NA>  NA           NA
#>  8 Table S4          4    19 TRUE     <NA>    character <NA>  NA           NA
#>  9 Table T4          4    20 TRUE     <NA>    character <NA>  NA           NA
#> 10 Table E5          5     5 TRUE     <NA>    character <NA>  NA           NA
#> # ℹ 188 more rows
#> # ℹ 14 more variables: date <dttm>, character <chr>,
#> #   character_formatted <list>, formula <chr>, is_array <lgl>,
#> #   formula_ref <chr>, formula_group <int>, comment <chr>, height <dbl>,
#> #   width <dbl>, row_outline_level <dbl>, col_outline_level <dbl>,
#> #   style_format <chr>, local_format_id <int>

Created on 2023-12-20 with reprex v2.0.2

nacnudus commented 9 months ago

That's an embarrassing bug. Thank you for providing a test case. I think it is fixed here, and can be installed with devtools::install_github(repo = "nacnudus/tidyxl"). I'll try to get it into CRAN before Christmas.

lymanmark commented 9 months ago

Thank you for the quick response. And the great package.

On Thu, Dec 21, 2023, 5:31 AM Duncan Garmonsway @.***> wrote:

That's an embarrassing bug. Thank you for providing a test case. I think it is fixed here, and can be installed with devtools::install_github(repo = "nacnudus/tidyxl"). I'll try to get it into CRAN before Christmas.

— Reply to this email directly, view it on GitHub https://github.com/nacnudus/tidyxl/issues/92#issuecomment-1866168878, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALPJAHHZY5KPDB3IUCK6LVLYKQTZ5AVCNFSM6AAAAABA5QLYHCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRWGE3DQOBXHA . You are receiving this because you authored the thread.Message ID: @.***>