i_median_grp | R Documentation |
Replaces NA
s in a numeric vector with the grouped medians of the non-NA
values.
Groups are defined by the f
argument.
i_median_grp(x, f, skip_f_na = TRUE)
x |
A numeric vector |
f |
A grouping variable, of the same length of |
skip_f_na |
If |
A numeric vector
x <- c(NA, runif(10), NA)
f <- c(rep("a", 6), rep("b", 6))
i_median_grp(x, f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.