SCM

[#1522] xtabs(..., exclude =, sparse = TRUE) fails

Date:
2011-08-13 10:40
Priority:
4
State:
Closed
Submitted by:
Felix Andrews (felix)
Assigned to:
Nobody (None)
Hardware:
None
Product:
None
Operating System:
None
Component:
None
Version:
None
Severity:
None
Resolution:
Fixed
URL:
Summary:
xtabs(..., exclude =, sparse = TRUE) fails

Detailed description
library(package = "Matrix")

x1 <- x2 <- c('a','b','a','b','c')

xtabs(~ x1 + x2, sparse = TRUE, exclude = 'c')
# Error in validObject(.Object) :
# invalid class "dgTMatrix" object: all row indices must be between 0 and nrow-1




sessionInfo()
R version 2.13.1 (2011-07-08)
Platform: i686-pc-linux-gnu (32-bit)

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] Matrix_0.999375-50 lattice_0.19-31

loaded via a namespace (and not attached):
[1] grid_2.13.1 tcltk_2.13.1 tools_2.13.1

Comments:

Message  ↓
Date: 2011-08-13 13:36
Sender: Martin Maechler

This is a bug in xtabs(), not in Matrix
{but at least one of the Matrix authors is *still* the culprit :-)}

I will patch xtabs() in R (2.13.1 patched + R-devel)

Attached Files:

Changes

Field Old Value Date By
details library(package = "Matrix") x1 <- x2 <- c('a','b','a','b','c') xtabs(~ x1 + x2, sparse = TRUE, exclude = 'c') # Error in validObject(.Object) : # invalid class "dgTMatrix" object: all row indices must be between 0 and nrow-1 sessionInfo() R version 2.13.1 (2011-07-08) Platform: i686-pc-linux-gnu (32-bit) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] Matrix_0.999375-50 lattice_0.19-31 loaded via a namespace (and not attached): [1] grid_2.13.1 tcltk_2.13.1 tools_2.13.1 2021-06-10 14:27mmaechler
ResolutionNone2021-06-10 14:27mmaechler
status_idOpen2011-08-13 13:36mmaechler
priority32011-08-13 13:36mmaechler
close_date2011-08-13 13:362011-08-13 13:36mmaechler
Thanks to:
Vienna University of Economics and Business Powered By FusionForge