Description Usage Arguments Details Value See Also Examples
Imputation by Cummutative Functions
Impute using replacement values calculated from a univariate, cummuative function.
na.median
imputes with the median value of x
. The median is only valid
for numeric or logical values.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
.x |
vector in which |
... |
additional arguments passed to lower-level summary functions. |
This collection of functions calculates a replacement value using an
unvariate function where the order of values in x
do not matter,
i.e. commutative.
na.max
and na.min
replace missing values (NA
) with the maximum or
minimum of non-missing values x
.
( Internally: base::max(..., na.rm=TRUE)
and base::min(..., na.rm=TRUE)
.
...
has no affect.
na.mean
replaces NA
values with the mean of x
. Internally,
mean(x, na.rm=TRUE, ... )
is used. If mean cannot be calculated (e.g. x
isn't numeric) then x
is returned with a warning.
na.quantile
imputes with a quantile. The quantile is specified by a
probs
argument that is passed to stats::quantile()
. If probs
can be
a scalar value in which all values are replaced by that quantile or a vector
of length(.x)
values which replaces the missing values of x with the
probs
. The ability to provide a vector may be deprecated in the future.
na.mode
replaces all NA
with the most frequently occuring value. In
the event of ties, the value encounter first in .x
is used.
na.most_freq
is an alias for na.mode
.
A vector of class(x)
and length(x)
in which missing values (NA) have
been replaced the result of a function call:
fun(x, ...)
na.replace()
- used internally by these functions
na.constant()
base::max()
and base::min()
quantile()
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.