Skip to content

another dump/source problem?

2 messages · Peter Kleiweg, Ross Ihaka

#
Is this a bug?

I do this:

    library(mva)
    data(USArrests)
    d <- dist(USArrests)
    dump("d", "tst")
    q()

I restart R and do this:

    source("tst")

And I get:

    Error in as.matrix(x) : Object "USArrests" not found




Version:
 platform = i686-pc-linux-gnu
 arch = i686
 os = linux-gnu
 system = i686, linux-gnu
 status =
 major = 1
 minor = 7.1
 year = 2003
 month = 06
 day = 16
 language = R
#
Peter Kleiweg wrote:

            
Yes.  If you look inside the saved file it contains

	..., call = dist(x = USArrests), ...

When this is reread, an attempt is made to evaluate the call.
Some kind of quoting is needed.