Dear Moritz!

An easy solution for you would be to separately write the factor-values (the integers)
and the levels:

>h5write(as.integer(obj), file=file, name="objCODES")
>h5write(levels(obj), file=file, name="objLEVELS")

Best,

Bernd



--
Bernd Fischer
EMBL Heidelberg
Meyerhofstraße 1
69117 Heidelberg
Tel: +49 [0] 6221 387-8131
E-Mail: bernd.fischer@embl.de
Homepage: http://www-huber.embl.de/users/befische/






On 23.01.2013, at 16:05, Moritz Emanuel Beber <moritz.beber@gmail.com> wrote:

> Dear all,
> 
> I sent a message to Bernd Fischer the maintainer of rhdf5 directly but got no response from him. My qualm lies with the writing and re-reading of factor vectors using rhdf5. In the current release they are simply written as integers and upon reading the HDF5 files the levels are obviously forgotten.
> 
> Of course, I could convert the factors to character vectors before writing but I wanted to ask whether there is a plan to implement better factor support or if it's feasible to contribute code to facilitate such support.
> 
> TIA,
> Moritz
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor


	[[alternative HTML version deleted]]

