Skip to contents

The amalgamated part is appended last; the retained parts keep their original order. parts is one-based.

Usage

Amalgam(x, parts, total = 1)

Arguments

x

Strictly positive vector of parts.

parts

One-based indices of the parts summed together.

total

Constant the result sums to.

Value

List with composition, amalgamated, parts, kept, D.

Details

Formula: amalg(x; S) = C( (x_i : i not in S), sum_{j in S} x_j )

References

Aitchison (1986), The Statistical Analysis of Compositional Data, Chapter 2, which defines amalgamation and notes that it does not preserve the log-ratio structure.

Examples

V <- c(1, 2, 3, 4, 5, 6, 7, 8)
Amalgam(V, V)
#> $composition
#> [1] 1
#> 
#> $amalgamated
#> [1] 36
#> 
#> $parts
#> [1] 1 2 3 4 5 6 7 8
#> 
#> $kept
#> integer(0)
#> 
#> $D
#> [1] 1
#> 
#> $method
#> [1] "Amalgamation"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"