[Rd] Bug in plot.formula (PR#757)

presnell@stat.ufl.edu presnell@stat.ufl.edu
Mon, 4 Dec 2000 17:29:56 +0100 (MET)


Here's a simple example:

  > x <- rnorm(20)
  > y <- 1 + 10*x + rnorm(20)
  > plot(y ~ x, subset=2*(1:10),xlab="In",ylab="Out")
  Error in length(x) == l : comparison (1) is possible only for vector types

The problem seems to be in this section of the code for plot.formula:

  if (!missing(subset)) {
    s <- eval(m$subset, data, parent.frame())
    l <- nrow(data)
    dosub <- function(x) if (length(x) == l) 
      x[s]
    else x
    dots <- lapply(dots, dosub)
  }

Sorry, no time this morning to attempt a fix myself, but I thought it
best to get this in before 1.2 is released.


Version:
 platform = sparc-sun-solaris2.6
 arch = sparc
 os = solaris2.6
 system = sparc, solaris2.6
 status = 
 major = 1
 minor = 1.1
 year = 2000
 month = August
 day = 15
 language = R

Search Path:
 .GlobalEnv, Autoloads, package:base

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._