% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/S3_aggregations.R
\name{colSums}
\alias{colSums}
\alias{rowSums}
\alias{colSums.HDF5Matrix}
\alias{rowSums.HDF5Matrix}
\title{Column and row sums for HDF5Matrix}
\usage{
colSums(x, na.rm = FALSE, dims = 1L, ...)

rowSums(x, na.rm = FALSE, dims = 1L, ...)

\method{colSums}{HDF5Matrix}(
  x,
  na.rm = FALSE,
  dims = 1,
  paral = NULL,
  wsize = NULL,
  threads = NULL,
  save_to = NULL,
  overwrite = TRUE,
  ...
)

\method{rowSums}{HDF5Matrix}(
  x,
  na.rm = FALSE,
  dims = 1,
  paral = NULL,
  wsize = NULL,
  threads = NULL,
  save_to = NULL,
  overwrite = TRUE,
  ...
)
}
\arguments{
\item{x}{An \code{HDF5Matrix} object.}

\item{na.rm}{Ignored (included for compatibility with the base generic).}

\item{dims}{Ignored (included for compatibility with the base generic).}

\item{...}{Ignored.}

\item{paral}{Logical or NULL. Enable OpenMP parallelisation.}

\item{wsize}{Integer or NULL. Block size for HDF5 reads (NULL = auto).}

\item{threads}{Integer or NULL. Number of OpenMP threads (NULL = auto).}

\item{save_to}{Where to save the result (see Details).  NULL returns a
plain R vector; a character string \code{"group/dataset"}
saves in the same file as \code{x}; a named list
\code{list(file = "f.h5", path = "group/dataset")} saves in
a different file.  In both non-NULL cases an
\code{HDF5Matrix} handle is returned.}

\item{overwrite}{Logical.  Overwrite an existing dataset at \code{save_to}?
(Currently always TRUE when \code{save_to} is not NULL.)}
}
\value{
A numeric vector (when \code{save_to = NULL}) or an
\code{HDF5Matrix} handle to the persisted result.
}
\description{
Block-wise computation of column and row sums without loading the full
matrix into RAM.  Results can optionally be persisted to an HDF5 file.
}
\examples{
\donttest{
tmp <- tempfile(fileext = ".h5")
X <- hdf5_create_matrix(tmp, "data/M", data = matrix(rnorm(200), 20, 10))
cs <- colSums(X)         # R vector
hdf5_close_all()
unlink(tmp)
}

}
