Description Usage Arguments Details Value Author(s) Examples
This method replaces NA-Values in a vector by the mean of the neighboring values. Example: c(1,NA,3) is converted to c(1,2,3).
1 | na2mean(x)
|
x |
Vector to fill |
The method does not work if multiple NA are in sequence.
Vector with NA replaced by mean.
Dominik Reusser
1 2 |
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
[1] 1.0 1.5 2.0
[1] 1 NA NA 2
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.