apply-methods: apply() for big.matrix objects.

Description Methods Examples

Description

apply for big.matrix objects. Note that the performance may be degraded (compared to apply with regular R matrices) because of S4 overhead associated with extracting data from big.matrix objects. This sort of limitation is unavoidable and would be the case (or even worse) with other "custom" data structures. Of course, this would only be partically significant if you are applying over lengthy rows or columns.

Methods

apply

signature(x = "big.matrix"): apply() where MARGIN may only be 1 or 2, but otherwise conforming to what you would expect from apply().

Examples

1
2
3
4
5
6
library(bigmemory)

x <- big.matrix(5, 2, type="integer", init=0, 
                dimnames=list(NULL, c("alpha", "beta")))
x[,] <- round(rnorm(10))
apply(x, 1, mean)

biganalytics documentation built on May 2, 2019, 4:45 p.m.