[Rd] all.equal(data.frame(package_version()), ...) infinite recursion

From: William Dunlap <wdunlap_at_tibco.com>
Date: Tue, 12 Apr 2011 08:32:41 -0700


With R-2.12.2 on Linux:

> z <- data.frame(Version=package_version(c("0.1")),
row.names=c("pkgA"))
> all.equal(z, z) # expect TRUE

  Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
> traceback()

  ... lots of lines in a 3-cycle ...
  6: all.equal.list(target, current, ...)   5: all.equal.default(target[[i]], current[[i]], check.attributes = check.attributes,

         ...)
  4: all.equal(target[[i]], current[[i]], check.attributes = check.attributes,

         ...)

  3: all.equal.list(target, current, ...)
  2: all.equal.default(z, z)
  1: all.equal(z, z)

This is probably because the [[ method for package_version ([[.numeric_version)
acts like a typical [ method, not a [[ method, so all.equal's call to [[ does
not burrow into the list:
> is.list(z$Version)

  [1] TRUE
> identical(z$Version[[1]], z$Version)
  [1] TRUE Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue 12 Apr 2011 - 15:38:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 12 Apr 2011 - 16:40:44 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive