[R] dump() bug?

Ray Brownrigg ray at mcs.vuw.ac.nz
Wed Nov 27 08:59:10 CET 2002


Is this a bug?  Certainly it was not expected.  dump() seems to prefer a
global definition over a local one.  R 1.6.1 on Solaris 8 or NetBSD:

> ls()
character(0)
> dump("D", "D.q")	# a global D() exists
> system("cat D.q")
"D" <-
function (expr, name)
.Internal(D(expr, name))
> D <- function(x) print(x)	# now create a local one
> ls()
[1] "D"
> dump("D", "D.q")
> system("cat D.q")	# here's the surprise
"D" <-
function (expr, name)
.Internal(D(expr, name))
> 
The same thing happens with dump(list=ls(), "D.q").

Ray Brownrigg
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help 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-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list