[Rd] another save/load problem, only(?) affecting ascii = TRUE (PR#507)

maechler@stat.math.ethz.ch maechler@stat.math.ethz.ch
Mon, 3 Apr 2000 14:37:43 +0200 (MET DST)


On all current R versions, afaik:

When using  save(....., ascii = TRUE),
the resulting file is not always readable by load(.).

The following is executable R code
exhibiting two (slightly different) examples
of which I have seen even more [~/R/MISC/saveload-bug.R]:

### BUG :  save(..., ascii = TRUE)  produces load() -  unreadable files :

tstf1 <- function(n = 500)
{
    ## Purpose:
    ## -----------------------------------------------------------------------
    ## Author: Martin Maechler, Date: 29 Mar 2000, 15:40
    ## -----------------------------------------------------------------------
    n2 <- n %/% 2
    nk <- n2 * 4
    CPU <- numeric(n)
    ## -----------------------------------------------------------------------
    for(i in 1:n) { ## just a simple pseudo loop
        n <- n*nk
        CPU[i] <- i^n
    }
    CPU
}

tstf2 <- function(n = 500)
{
    ## Author: Martin Maechler, Date: 1 Apr 2000, 15:40
    n %/% 2
}

save(tstf1, file="foo1",ascii=TRUE); load(file="foo1")
## Error in load(file = "foo1") : NewReadItem: unknown type -1073749696
save(tstf2, file="foo2",ascii=TRUE); load(file="foo2")
## Error in load(file = "foo2") : NewReadItem: unknown type 92

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._