ycphs / openxlsx

openxlsx - a fast way to read and write complex xslx files
https://ycphs.github.io/openxlsx/
Other
220 stars 74 forks source link

Documentation doesn't match functionality in `read.xlsx` for `na.strings` #420

Closed Moohan closed 5 months ago

Moohan commented 1 year ago

The default for na.strings is "NA" but the documentation says:

A character vector of strings which are to be interpreted as NA. Blank cells will be returned as NA.

read.xlsx actually does both, for example in this workbook: Book1.xlsx The columns have blank "", literal NA "NA" and Excel type NA #N/A but read.xlsx will read them all as NA.

openxlsx::read.xlsx("Book1.xlsx")
#>   var test1 test2
#> 1   1     a  <NA>
#> 2   2  <NA>  <NA>
#> 3   3     b     c
#> 4   4     c     a

Created on 2023-03-21 with reprex v2.0.2

From the documentation, I would have expected only the blanks "" to be read as NA.

Not sure if this is a bug or if the documentation needs updating.

github-actions[bot] commented 5 months ago

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 5 months ago

This issue was closed because it has been stalled for 7 days with no activity.