View source: R/S3_aggregations.R
| colMeans | R Documentation |
Block-wise computation of column and row means without loading the full matrix into RAM.
colMeans(x, na.rm = FALSE, dims = 1L, ...)
rowMeans(x, na.rm = FALSE, dims = 1L, ...)
## S3 method for class 'HDF5Matrix'
colMeans(
x,
na.rm = FALSE,
dims = 1,
paral = NULL,
wsize = NULL,
threads = NULL,
save_to = NULL,
overwrite = TRUE,
...
)
## S3 method for class 'HDF5Matrix'
rowMeans(
x,
na.rm = FALSE,
dims = 1,
paral = NULL,
wsize = NULL,
threads = NULL,
save_to = NULL,
overwrite = TRUE,
...
)
x |
An |
na.rm |
Ignored (included for compatibility with the base generic). |
dims |
Ignored (included for compatibility with the base generic). |
... |
Ignored. |
paral |
Logical or NULL. Enable OpenMP parallelisation. |
wsize |
Integer or NULL. Block size for HDF5 reads (NULL = auto). |
threads |
Integer or NULL. Number of OpenMP threads (NULL = auto). |
save_to |
Where to save the result (see Details). NULL returns a
plain R vector; a character string |
overwrite |
Logical. Overwrite an existing dataset at |
A numeric vector (when save_to = NULL) or an
HDF5Matrix handle to the persisted result.
tmp <- tempfile(fileext = ".h5")
X <- hdf5_create_matrix(tmp, "data/M", data = matrix(rnorm(200), 20, 10))
cm <- colMeans(X)
hdf5_close_all()
unlink(tmp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.