Skip to contents

Imputation function for a date column

Usage

date_imputer(x, col, method = "median")

Arguments

x

input data tibble

col

name of the column to modify

method

name of the imputing strategy.

Value

output data tibble after imputation

Examples

input_df <- data.frame(a = (c(as.Date('1990/02/17'), as.Date('1991/02/17'), NA, as.Date('1992/02/17'))))
date_imputer(input_df, "a", "median")
#>            a
#> 1 1990-02-17
#> 2 1991-02-17
#> 3 2023-01-29
#> 4 1992-02-17