Learn R Programming

biganalytics (version 1.1.12)

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

Description

apply for big.matrix objects. Note that the performance may be degraded (compared to apply with regular Rmatrices) 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.

Arguments

Examples

Run this code
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)

Run the code above in your browser using DataLab