sum {freegroup}R Documentation

Repeated summation by concatenation

Description

Concatenates its arguments to give a single free object

Usage

## S3 method for class 'free'
sum(..., na.rm = FALSE)

Arguments

...

Objects of class free, to be summed

na.rm

Boolean, indicating whether to ignore NA entries (currently ignored)

Details

Concatenates its arguments and gives a single element of the free group. It works nicely with rev(), see the examples.

Note

The package uses additive notation, but it is easy to forget this and wonder why idiom like prod(rfree()) does not work as desired. Of course, the package using additive notation means that one probably wants sum(rfree()).

Author(s)

Robin K. S. Hankin

Examples


(x <- rfree(10,3))
sum(x)
abelianize(sum(x))

(y <- rfree(10,6))

sum(x,y)
sum(x,y) == sum(sum(x),sum(y))
x+y  # not the same!

sum(x,-x)
sum(x,rev(-x))

z <- alpha(26)
stopifnot(sum(x^z) == sum(x)^z)


[Package freegroup version 1.1-8 Index]