RowMeans: Form Row Sums and Means

Description Usage Arguments Value See Also Examples

View source: R/RowSums.R

Description

Form row sums and means for numeric arrays.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
RowSums (x, ...)
RowMeans(x, ...)
## Default S3 method:
RowSums(x, ...)
## Default S3 method:
RowMeans(x, ...)
## S3 method for class 'tis'
RowSums(x, ...)
## S3 method for class 'tis'
RowMeans(x, ...)

Arguments

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 or rowMeans.

Value

The tis-specific methods return a tis.

For other types of x, see rowMeans or rowSums.

See Also

rowMeans, and rowSums

Examples

1
2
mat <- tis(matrix(1:36, ncol = 3), start = latestJanuary())
cbind(mat, rowSums(mat), rowMeans(mat))

Example output

         mat.1 mat.2 mat.3 rowSums(mat) rowMeans(mat)
20180131     1    13    25           39            13
20180228     2    14    26           42            14
20180331     3    15    27           45            15
20180430     4    16    28           48            16
20180531     5    17    29           51            17
20180630     6    18    30           54            18
20180731     7    19    31           57            19
20180831     8    20    32           60            20
20180930     9    21    33           63            21
20181031    10    22    34           66            22
20181130    11    23    35           69            23
20181231    12    24    36           72            24
class: tis

tis documentation built on Sept. 29, 2021, 1:06 a.m.