matrixStats

R package: Methods that Apply to Rows and Columns of Matrices (and to Vectors)

https://github.com/henrikbengtsson/matrixstats

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.2%) to scientific vocabulary

Keywords

cran matrix package performance r vector

Keywords from Contributors

visualisation bioinformatics weighted human-cell-atlas single-cell-genomics single-cell-rna-seq bioconductor
Last synced: 6 months ago · JSON representation

Repository

R package: Methods that Apply to Rows and Columns of Matrices (and to Vectors)

Basic Info
Statistics
  • Stars: 211
  • Watchers: 23
  • Forks: 35
  • Open Issues: 57
  • Releases: 0
Topics
cran matrix package performance r vector
Created over 11 years ago · Last pushed 8 months ago
Metadata Files
Readme Changelog Contributing

README.md

CRAN check status R CMD check status Build status Coverage Status A Google Summer of Code 2015 project A Google Summer of Code 2021 project

matrixStats: Functions that Apply to Rows and Columns of Matrices (and to Vectors)

Introduction

The matrixStats package provides highly optimized functions for computing common summaries over rows and columns of matrices, e.g. rowQuantiles(). There are also functions that operate on vectors, e.g. logSumExp(). Their implementations strive to minimize both memory usage and processing time. They are often remarkably faster compared to good old apply() solutions. The calculations are mostly implemented in C, which allow us to optimize beyond what is possible to do in plain R. The package installs out-of-the-box on all common operating systems, including Linux, macOS and Windows.

Example

With a matrix

```r

x <- matrix(rnorm(20 * 500), nrow = 20, ncol = 500) ```

it is many times faster to calculate medians column by column using

```r

mu <- matrixStats::colMedians(x) ```

than using

```r

mu <- apply(x, MARGIN = 2, FUN = median) ```

Moreover, if performing calculations on a subset of rows and/or columns, using

```r

mu <- colMedians(x, rows = 33:158, cols = 1001:3000) ```

is much faster and more memory efficient than

```r

mu <- apply(x[33:158, 1001:3000], MARGIN = 2, FUN = median) ```

Benchmarks

For formal benchmarking of matrixStats functions relative to alternatives, see the Benchmark reports.

Design goals

The objectives of the matrixStats package is to perform operations on matrices (i) as faster as possible, while (ii) not using unnecessary amounts of memory. These objectives drive the design, including the choice of the different defaults.

Installation

R package matrixStats is available on CRAN and can be installed in R as: r install.packages("matrixStats")

Pre-release version

To install the pre-release version that is available in Git branch develop on GitHub, use: r remotes::install_github("HenrikBengtsson/matrixStats", ref="develop") This will install the package from source. Because of this and because this package also compiles native code, Windows users need to have Rtools installed and macOS users need to have Xcode installed.

Contributing

To contribute to this package, please see CONTRIBUTING.md.

Owner

  • Name: Henrik Bengtsson
  • Login: HenrikBengtsson
  • Kind: user
  • Company: UCSF

Assoc Professor. R Foundation. R Consortium. Many R packages, e.g. future & matrixStats.

GitHub Events

Total
  • Issues event: 4
  • Watch event: 7
  • Issue comment event: 33
  • Pull request event: 4
  • Fork event: 1
Last Year
  • Issues event: 4
  • Watch event: 7
  • Issue comment event: 33
  • Pull request event: 4
  • Fork event: 1

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 1,693
  • Total Committers: 14
  • Avg Commits per committer: 120.929
  • Development Distribution Score (DDS): 0.158
Past Year
  • Commits: 51
  • Committers: 3
  • Avg Commits per committer: 17.0
  • Development Distribution Score (DDS): 0.294
Top Committers
Name Email Commits
hb hb@a****g 1,426
Dongcan Jiang d****g@g****m 172
Jakob Peder Pettersen j****n@g****m 39
BHGC Website GHA Workflow Runner b****h@b****g 15
AngelPn a****a@g****m 11
const-ae a****5@g****m 7
Brian Montgomery b****y@y****m 7
Peter Hickey p****y@g****m 5
HughParsonage h****e@g****m 4
Jan Gleixner j****r@g****m 2
Brennan Vincent b****n@u****m 2
Michael Chirico c****m@g****m 1
Hector Corrada Bravo h****a@g****m 1
Dirk Eddelbuettel e****d@d****g 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 131
  • Total pull requests: 26
  • Average time to close issues: 6 months
  • Average time to close pull requests: 5 months
  • Total issue authors: 47
  • Total pull request authors: 7
  • Average comments per issue: 3.18
  • Average comments per pull request: 2.31
  • Merged pull requests: 19
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 11
  • Pull requests: 7
  • Average time to close issues: 10 days
  • Average time to close pull requests: about 8 hours
  • Issue authors: 7
  • Pull request authors: 3
  • Average comments per issue: 2.09
  • Average comments per pull request: 1.71
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • HenrikBengtsson (57)
  • const-ae (9)
  • hpages (6)
  • PeteHaitch (4)
  • Eluvias (3)
  • yaccos (3)
  • karoliskoncevicius (3)
  • gdemin (2)
  • mayer79 (2)
  • arrayn (2)
  • kasperdanielhansen (1)
  • GabrielHoffman (1)
  • alyst (1)
  • Henrik-P (1)
  • TimTaylor (1)
Pull Request Authors
  • yaccos (18)
  • const-ae (5)
  • bkmontgom (4)
  • MichaelChirico (2)
  • HughParsonage (1)
  • jan-glx (1)
  • TimTaylor (1)
Top Labels
Issue Labels
bug (22) feature request (12) enhancement (9) names-attribute (7) ASAP (5) consistency (4) question (3) need-decision-before-fix (3) help wanted (2) pkg-test-needed (1) wontfix (1) knowledge (1)
Pull Request Labels
names-attribute (1) feature request (1)

Packages

  • Total packages: 2
  • Total downloads:
    • cran 175,361 last-month
  • Total docker downloads: 3,030,806
  • Total dependent packages: 332
    (may contain duplicates)
  • Total dependent repositories: 1,175
    (may contain duplicates)
  • Total versions: 71
  • Total maintainers: 1
cran.r-project.org: matrixStats

Functions that Apply to Rows and Columns of Matrices (and to Vectors)

  • Versions: 59
  • Dependent Packages: 295
  • Dependent Repositories: 1,130
  • Downloads: 175,361 Last month
  • Docker Downloads: 3,030,806
Rankings
Dependent repos count: 0.4%
Dependent packages count: 0.4%
Downloads: 0.8%
Forks count: 2.2%
Stargazers count: 2.3%
Average: 3.9%
Docker downloads count: 17.3%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: r-matrixstats
  • Versions: 12
  • Dependent Packages: 37
  • Dependent Repositories: 45
Rankings
Dependent packages count: 1.9%
Dependent repos count: 5.4%
Average: 16.0%
Stargazers count: 27.3%
Forks count: 29.5%
Last synced: 6 months ago

Dependencies

.github/workflows/R-CMD-check-valgrind.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/upload-artifact v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
.github/workflows/covr.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
DESCRIPTION cran
  • R >= 2.12.0 depends
  • R.devices * suggests
  • R.rsp * suggests
  • base64enc * suggests
  • ggplot2 * suggests
  • knitr * suggests
  • markdown * suggests
  • microbenchmark * suggests