| sum | R Documentation |
Concatenates its arguments to give a single free object
## S3 method for class 'free'
sum(..., na.rm = FALSE)
... |
Objects of class |
na.rm |
Boolean, indicating whether to ignore |
Function sum() concatenates its arguments and gives a single
element of the free group. It works nicely with rev(), see the
examples. Note that sum(x,y) is not the same as x+y.
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()).
Robin K. S. Hankin
(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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.