hdf5r icon indicating copy to clipboard operation
hdf5r copied to clipboard

NA handling for strings does not work properly

Open hhoeflin opened this issue 7 years ago • 3 comments

hhoeflin avatar Jun 05 '17 15:06 hhoeflin

How should string handling of NA work properly? Is there an NA string in HDF5? How does h5 handle it?

hhoeflin avatar Jun 05 '17 15:06 hhoeflin

As far as I remember h5 stores NA strings as "NA"and converts them to NA_character_ when reading back.

mannau avatar Oct 20 '18 19:10 mannau

NA values in factors are broken, too:

> x = H5File$new("/tmp/test.h5", mode = "w")
> x[["foo"]] = factor(c("a", "b", "a", "a", "b", NA))
Warning message:
In ds$write_low_level(robj) :
  During conversion, the following issues occured: H5T_CONV_EXCEPT_RANGE_LOW
> x[["foo"]][]
Error in as.character.factor(x) : malformed factor

Kodiologist avatar Aug 07 '19 14:08 Kodiologist