Description Usage Arguments Value Examples
View source: R/na_replace_grouped.R View source: R/na_replace_grouped.R
A convenient way to replace NAs by group.
1 | na_replace_grouped(df, group_by_cols = NULL, ...)
|
df |
A data.frame object for which grouped NA replacement is desired. |
group_by_cols |
The column(s) used to use for the grouping. |
... |
Other arguments to 'na_replace' |
A 'data.frame' object with 'NA's replaced.
1 2 3 | test2 <- data.frame(A=c("A","A","A","B","B","B"),
B=c(NA,5,2,2,NA,2))
head(na_replace_grouped(test2,"A",how="value","Replaced"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.