Skip to content

zero-offset matrices (PR#132)

1 message · Peter Dalgaard

#
Prof Brian Ripley <ripley@stats.ox.ac.uk> writes:
Yup, there's a bug in there somewhere, MatrixAssign ends up getting
called with the symbol "value" where the actual replacement value
should have been.

Of course, the whole point becomes a bit moot when one considers
*removing* rows and columns from a matrix...

To tickle the bug:

"[<-.zoffset"  <- function(x, i, j, value)
{
  if(!missing(i) && is.numeric(i)) i <- i+1
  if(!missing(j) && is.numeric(j)) j <- j+1
  NextMethod("[<-")
}
m<-matrix(1:4,2,2)
m[0,]<-4:5

Probably, set a breakpoint in do_subassigne and step through it.