Sum and Product.

Share:

Description

Compute sum or product of madness objects.

Usage

1
2
3
4
5
## S4 method for signature 'madness'
sum(x, ..., na.rm = FALSE)

## S4 method for signature 'madness'
prod(x, ..., na.rm = FALSE)

Arguments

x

a numeric or madness object.

...

ignored here.

na.rm

logical. Should missing values (including ‘NaN’) be removed?

Value

a madness object representing a scalar value.

Author(s)

Steven E. Pav shabbychef@gmail.com

Examples

1
2
3
4
xv <- matrix(rnorm(5*5),ncol=5)
xmad <- madness(xv)
prod(xv)
sum(xv)