[Rd] [Fwd: buglet (?) in de.restore()]

From: Ben Bolker <bolker_at_zoo.ufl.edu>
Date: Mon, 10 Sep 2007 08:47:18 -0400

  I'm resending this after a decent interval of 20 days -- any opinions? Should I file it as a bug report? Is it my mistake?

    Ben Bolker

  If one calls data.entry() with a matrix:

A = matrix(0,2,2)

everything works fine except that it triggers a warning:

Warning message:
the condition has length > 1 and only the first element will be used in:   if (dim(x) == dim(args[[i]])) rn <- dimnames(args[[i]])[[1]] else rn <- NULL

This is triggered by the following lines in de.restore() [in src/library/utils/R/de.R]:

>   if( dim(x) == dim(args[[i]]) )
>                 rn <- dimnames(args[[i]])[[1]]
>             else rn <- NULL

  It would seem to make sense to replace the condition with

if (nrow(x) == nrow(args[[i]]))

  (de.restore() is only called if an element of the list passed to data.entry
has more than one column)

 On a side note, I'm curious why

> > A = matrix(0,2,2)
> > is.vector(A)

> [1] FALSE

> > is(A,"vector")

> [1] TRUE

R version 2.5.1 (2007-06-27)


attached base packages:
[1] "stats" "graphics" "grDevices" "utils" "datasets" "methods" [7] "base"

R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue 11 Sep 2007 - 01:18:06 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 11 Sep 2007 - 04:40:25 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.