Handle factors in `asdataframe`