Description Usage Arguments Details Value Author(s) See Also Examples
This generic function is useful for dealing with NA
s. It returns the object and replaces missing values by a vale which is very large compared to the range of values in that object. This can be reasonable if a robust estimation procedure is applied which is influenced not at all or only very little by extreme observations.
1 2 3 4 | na.extremify(object, ...)
## S3 method for class 'ts'
na.extremify(object, ...)
|
object |
an object. Currently there is only a methods for numeric vectors. |
... |
currently ignored. |
Missing values are replaced by the value max(object) + 1e+03 * diff(range(object))
rounded up to the next power of 10.
This approach is only sensible if the proportion of missing values is lower than the breakdown point of the robust procedure which will be applied to the data afterwards. Note that all missing values are replaced by the same large value. The induced discreteness and asymmetry might cause problems for some robust estimation procedures.
The object without missing values. The class of object
will be preserved. If there are missing values in object
, the output has attribute "na.action"
which provides information on the missing values and how these have been handled.
Tobias Liboschik
na.action
; options
with argument na.action
for setting NA actions.
na.fail
, na.omit
, na.exclude
, na.pass
and na.contiguous
for other methods for handling missing values.
1 2 3 | x <- ts(c(1, 2, 3, 4, NA, 6, 7))
na.extremify(x)
median(na.extremify(x))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.