Re: [Rd] corruption of data with serialize(ascii=TRUE)

2006-02-09 Thread Roger D. Peng
Okay, I just wasn't sure of the source of the changes. In retrospect, character and other vectors did serialize/unserialize to the original objects. -roger Prof Brian Ripley wrote: > It is known (happens with save() too and did in earlier save formats). > Nothing particularly clever is done (

Re: [Rd] corruption of data with serialize(ascii=TRUE)

2006-02-08 Thread Prof Brian Ripley
It is known (happens with save() too and did in earlier save formats). Nothing particularly clever is done (the format is "%.16g\n") and similarly as.character/parse are not inverses. Perhaps more relevant is > b/x -1 [1] 0.00e+00 -1.110223e-16 2.220446e-16 0.00e+00 0.00e+00

[Rd] corruption of data with serialize(ascii=TRUE)

2006-02-08 Thread Roger D. Peng
I noticed the following peculiarity with `serialize()' when `ascii = TRUE' is used. In today's (svn r37299) R-devel, I get > set.seed(10) > x <- rnorm(10) > > a <- serialize(x, con = NULL, ascii = TRUE) > b <- unserialize(a) > > identical(x, b) ## FALSE [1] FALSE > x - b [1] -3.469447