New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numbers as NA strings interact incorrectly with shared strings [xlsx] #401

Closed
jennybc opened this Issue Oct 20, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@jennybc
Member

jennybc commented Oct 20, 2017

reprex::reprex_info()
#> Created by the reprex package v0.1.1.9000 on 2017-10-23

devtools::load_all(".")
#> Loading readxl

## content of the sheet:
## a  b
## c  d

## note that "d" becomes NA but "b" does not --> CORRECT
read_excel(
  test_sheet("numbers-as-na-and-shared-strings-xls.xls"),
  na = c("1", "d")
)
#> # A tibble: 1 x 2
#>       a     c
#>   <chr> <lgl>
#> 1     b    NA

## here's the problem in xlsx:
## "b" becomes NA becomes it's element 1 in shared string table (0-indexed)
read_excel(
  test_sheet("numbers-as-na-and-shared-strings-xlsx.xlsx"),
  na = c("1", "d")
)
#> # A tibble: 1 x 2
#>       a     c
#>   <lgl> <lgl>
#> 1    NA    NA

@jennybc jennybc changed the title from Something's up when there are ?3 or more NA strings? to NA strings aren't always processed properly in xlsx Oct 23, 2017

@jennybc jennybc changed the title from NA strings aren't always processed properly in xlsx to Numbers as NA strings interact incorrectly with shared strings [xlsx] Oct 23, 2017

@jennybc jennybc closed this in c02f81c Oct 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment