```
rowSums (x, ...)
rowMeans(x, ...)
## S3 method for class 'default':
rowSums(x, na.rm = FALSE, dims = 1, \dots)
## S3 method for class 'default':
rowMeans(x, na.rm = FALSE, dims = 1, \dots)
## S3 method for class 'tis':
rowSums(x, \dots)
## S3 method for class 'tis':
rowMeans(x, \dots)
```

x

an array of two or more dimensions, containing numeric,
complex, integer or logical values, or a numeric data frame, or a

`tis`

time indexed series...

arguments passed along to

`rowSums.default`

or
`rowMeans.default`

, which are actually the versions of
`rowSums`

and `rowMeans`

from the `base`

package. The ...argument is ignored in `rowSums.d`

na.rm

logical. Should missing values (including

`NaN`

)
be omitted from the calculations?dims

Which dimensions are regarded as rows or
columns to sum over. For

`row*`

, the sum or mean is
over dimensions `dims+1, ...`

; for `col*`

it is over
dimensions `1:dims`

- A numeric or complex array of suitable size, or a vector if the result is
one-dimensional. The
`dimnames`

(or`names`

for a vector result) are taken from the original array.If there are no values in a range to be summed over (after removing missing values with

`na.rm = TRUE`

), that component of the output is set to`0`

(`rowSums`

) or`NA`

(`rowMeans`

), consistent with`sum`

and`mean`

.The

`tis`

-specific methods also return a`tis`

.

`apply`

with
`FUN = mean`

or `FUN = sum`

with appropriate margins, but
are a lot faster. As they are written for speed, they blur over some
of the subtleties of `NaN`

and `NA`

.
If `na.rm = FALSE`

and either `NaN`

or `NA`

appears in
a sum, the result will be one of `NaN`

or `NA`

, but which
might be platform-dependent.`apply`

, `rowsum`

, and `colSums`

for more details and examples.```
mat <- tis(matrix(1:36, ncol = 3), start = latestJanuary())
cbind(mat, rowSums(mat), rowMeans(mat))
```

Run the code above in your browser using DataCamp Workspace