The R Project SVN R

Rev

Rev 68948 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68948 Rev 87240
Line 1... Line 1...
1
% File src/library/base/man/colSums.Rd
1
% File src/library/base/man/colSums.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2015 R Core Team
3
% Copyright 1995-2024 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{colSums}
6
\name{colSums}
7
\alias{colSums}
7
\alias{colSums}
8
\alias{rowSums}
8
\alias{rowSums}
Line 12... Line 12...
12
\alias{.rowSums}
12
\alias{.rowSums}
13
\alias{.colMeans}
13
\alias{.colMeans}
14
\alias{.rowMeans}
14
\alias{.rowMeans}
15
\title{Form Row and Column Sums and Means}
15
\title{Form Row and Column Sums and Means}
16
\description{
16
\description{
17
  Form row and column sums and means for numeric arrays (or data frames).
17
  Form (generalized) row and column sums and means for numeric arrays (or data frames).
18
}
18
}
19
\usage{
19
\usage{
20
colSums (x, na.rm = FALSE, dims = 1)
20
colSums (x, na.rm = FALSE, dims = 1)
21
rowSums (x, na.rm = FALSE, dims = 1)
21
rowSums (x, na.rm = FALSE, dims = 1)
22
colMeans(x, na.rm = FALSE, dims = 1)
22
colMeans(x, na.rm = FALSE, dims = 1)
23
rowMeans(x, na.rm = FALSE, dims = 1)
23
rowMeans(x, na.rm = FALSE, dims = 1)
24
 
24
 
25
.colSums(x, m, n, na.rm = FALSE)
25
.colSums (x, m, n, na.rm = FALSE)
26
.rowSums(x, m, n, na.rm = FALSE)
26
.rowSums (x, m, n, na.rm = FALSE)
27
.colMeans(x, m, n, na.rm = FALSE)
27
.colMeans(x, m, n, na.rm = FALSE)
28
.rowMeans(x, m, n, na.rm = FALSE)
28
.rowMeans(x, m, n, na.rm = FALSE)
29
}
29
}
30
\arguments{
30
\arguments{
31
  \item{x}{an array of two or more dimensions, containing numeric,
31
  \item{x}{an array of two or more dimensions, containing numeric,
32
    complex, integer or logical values, or a numeric data frame.  For
32
    complex, integer or logical values, or a numeric data frame.  For
33
    \code{.colSums()} etc, a numeric, integer or logical matrix (or
33
    \code{.colSums()} etc, a numeric, integer or logical matrix (or
34
    vector of length \code{m * n}).}
34
    vector of length \code{m * n}).}
35
  \item{na.rm}{logical.  Should missing values (including \code{NaN})
35
  \item{na.rm}{logical.  Should missing values (including \code{NaN})
36
    be omitted from the calculations?}
36
    be omitted from the calculations?}
37
  \item{dims}{integer: Which dimensions are regarded as \sQuote{rows} or
37
  \item{dims}{integer number: Which dimensions are regarded as \sQuote{rows} or
38
    \sQuote{columns} to sum over.  For \code{row*}, the sum or mean is
38
    \sQuote{columns} to sum over.  For \code{row*}, the sum or mean is
39
    over dimensions \code{dims+1, \dots}; for \code{col*} it is over
39
    over dimensions \code{dims+1, \dots}; for \code{col*} it is over
40
    dimensions \code{1:dims}.}
40
    dimensions \code{1:dims}.}
41
  \item{m, n}{the dimensions of the matrix \code{x} for
41
  \item{m, n}{the dimensions of the matrix \code{x} for
42
    \code{.colSums()} etc.}
42
    \code{.colSums()} etc.}