Description Usage Arguments Details Value See Also Examples
Existing statistical functions give the same result when used with a
DemographicArray
array as they would with an
ordinary array
- except when the demographic array
has a dimension with dimtype
"iteration"
or
"quantile"
. When there is an "iteration"
dimension,
the calculations are repeated once for each iteration, so that the
return value is also a demographic array with an "iteration"
dimension.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## S4 method for signature 'DemographicArrayOrNumeric'
Summary(x, ..., na.rm = FALSE)
## S4 method for signature 'DemographicArray'
mad(
x,
center = median(x),
constant = 1.4826,
na.rm = FALSE,
low = FALSE,
high = FALSE
)
## S4 method for signature 'DemographicArray'
mean(x, ...)
## S4 method for signature 'DemographicArray'
median(x, na.rm = FALSE, ...)
|
x |
Typically an object of class |
... |
Other arguments. |
na.rm |
Logical. Whether to remove missing values before calculating. |
center |
Function used to calculate central value. Defaults
to |
constant |
See documentation for |
low |
See documentation for |
high |
See documentation for |
When called on an ordinary array, the functions all return a single
number, except for range
, which returns 2. When called on
a demographic array with an "iteration"
dimension, range
returns a demographic array with a dimension called "range"
,
in addition to the "iteration"
dimension.
When a demographic array has a dimension with dimtype
"quantile"
, applying statistical functions typically does
not make sense, and an error is raised. It is generally better to work
with the original array, with the complete set of iterations, and to
reduce to quantiles once the calculations are complete.
Numeric, if x
does not contain an "iteration"
dimension, and Counts
or Values
if it
does.
Iteration and quantile dimensions are described in the
documentation for dimtypes
. To remove iteration
dimensions (by summarising across them) use
collapseIterations
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.