fill_na | R Documentation |
use tidyselect to fill NA
values
Default behavior is to fill all integer or double columns cols with 0, preserving their types.
fill_na(.data, ..., fill = 0L, missing_type = c("all", "NA", "NaN", "Inf"))
.data |
data frame |
... |
tidyselect specification. Default selection: none |
fill |
value to fill missings |
missing_type |
character vector. Choose what type of missing to fill. Default is all types. choose from "all", "Na", "NaN", "Inf" |
data frame
tibble::tibble(x = c(NA, 1L, 2L, NA, NaN, 5L, Inf)) -> tbl
tbl %>%
fill_na()
tbl %>%
fill_na(fill = 1L, missing_type = "Inf")
tbl %>%
fill_na(missing_type = "NaN")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.