hdf5r
hdf5r copied to clipboard
NA handling for strings does not work properly
How should string handling of NA work properly? Is there an NA string in HDF5? How does h5 handle it?
As far as I remember h5 stores NA strings as "NA"
and converts them to NA_character_
when reading back.
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