const-ae / const-ae/sparseMatrixStats

colVars for dgeMatrix

Open
#24 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
R
Stars
55
Forks
3
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.