Skip to content

Commit 6b1afee

Browse files
foundinblankhadley
authored andcommitted
added new example using mutate() (#428)
to further clarify how to use replace_na() in data frames. from #427
1 parent 32b73ea commit 6b1afee

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

R/replace_na.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#' library(dplyr)
1111
#' df <- tibble(x = c(1, 2, NA), y = c("a", NA, "b"), z = list(1:5, NULL, 10:20))
1212
#' df %>% replace_na(list(x = 0, y = "unknown"))
13+
#' df %>% mutate(x = replace_na(x, 0))
1314
#'
1415
#' # NULL are the list-col equivalent of NAs
1516
#' df %>% replace_na(list(z = list(5)))

0 commit comments

Comments
 (0)