Description Usage Arguments Value Author(s) See Also Examples
This function returns the sum of an numeric array (e.g. vector or matrix) while keeping its attributes.
1 | sumKeepAttr( x, keepNames = FALSE, na.rm = FALSE )
|
x |
an numeric array (e.g. vector or matrix). |
keepNames |
logical. Should the name(s) of the element(s) of |
na.rm |
logical. Passed to |
the sum (see sum
).
Arne Henningsen
1 2 3 4 5 | a <- 1:10
attr( a, "min" ) <- 1
attr( a, "max" ) <- 10
sum(a)
sumKeepAttr(a)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.