totals: Total sum of amounts

Description Usage Arguments Value Missing Policy Author(s) See Also Examples

View source: R/compositions.R

Description

Calculates the total amount by summing the individual parts.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
totals(x,...)
## S3 method for class 'acomp'
totals(x,...,missing.ok=TRUE)
## S3 method for class 'rcomp'
totals(x,...,missing.ok=TRUE)
## S3 method for class 'aplus'
totals(x,...,missing.ok=TRUE)
## S3 method for class 'rplus'
totals(x,...,missing.ok=TRUE)
## S3 method for class 'ccomp'
totals(x,...,missing.ok=TRUE)
          

Arguments

x

an amount/amount dataset

...

not used, only here for generic purposes

missing.ok

if TRUE ignores missings; if FALSE issues an error if the total cannot be calculated due to missings.

Value

a numeric vector of length equal to ncol(x) containing the total amounts

Missing Policy

if missing.ok=TRUE missings are just regarded as 0, if missing.ok=FALSE WZERO values is still regarded as 0 and other sorts lead to NA in the respective totals.

Author(s)

K.Gerald v.d. Boogaart http://www.stat.boogaart.de

See Also

aplus

Examples

1
2
3
4
5
6

compositions documentation built on Jan. 5, 2022, 5:09 p.m.