fill_na {framecleaner} | R Documentation |
Fill NAs
Description
use tidyselect to fill NA
values
Default behavior is to fill all integer or double columns cols with 0, preserving their types.
Usage
fill_na(.data, ..., fill = 0L, missing_type = c("all", "NA", "NaN", "Inf"))
Arguments
.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" |
Value
data frame
Examples
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")
[Package framecleaner version 0.2.1 Index]