const-ae / const-ae/sparseMatrixStats

colVars for dgeMatrix

Aperta
#24 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
R
Stelle
55
Fork
3
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I am working with large sparse matrices that, after some operations, can return non-sparse matrices of class `dgeMatrix`.

I must be missing something here, but when I try to get colVars for a `dgeMatrix`, I get

```
Error in MatrixGenerics:::.load_next_suggested_package_to_search(x) :
Failed to find a colVars() method for dgeMatrix objects.
```

even though `colMeans2` works just fine.

Here is some (hopefully) reproducible code:

```
m <- Matrix(nrow = 3, ncol = 6, data = rnorm(18), sparse = FALSE)
sparseMatrixStats::colVars(m)
```

PS: `matrixStats::colVars(m)` returns

```
Error in matrixStats::colVars(m) :
Argument 'x' must be a matrix or a vector.
```

and calling `as.matrix` prior to `matrixStats::colVars` is very slow on larger matrices.

Any help would be much appreciated.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start by reproducing the example with sparseMatrixStats::colVars() on a dgeMatrix, then trace the colVars dispatch alongside the working colMeans2 path. The issue is resolved when colVars works for dgeMatrix inputs without converting large matrices with as.matrix().

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
r
Ambito
data
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.