Open surfingkaka opened 5 years ago
I think the problem is with factors -- if I add stringsAsFactors = FALSE
it works:
> library(msgpack)
> data <- data.frame(a=seq(1,5), b=c("a","b","#","$","^"), stringsAsFactors=FALSE)
> pdf <- packMsg(data)
> unpackMsg(pdf)
a b
1 1 a
2 2 b
3 3 #
4 4 $
5 5 ^
Messagepack doesn't have a clear analogue of R attributes like factor levels, so they get dropped in translation. I'll think about whether factors should be translated to characters instead.
Sorry, I missed this reply earlier. Thank you. Factors themselves are integer vectors with a character associated with each integer. Maybe there is something that can be done with adding a separate map with integer to character mapping across the data.frame.
This is pretty fast library, I assume from this reply that you are actively supporting this.
Please see reproducible example below. Maybe i am doing something wrong
Using R serialize/unserialize