naniar (version 0.4.2)

impute_median: Impute the median value into a vector with missing values

Description

Impute the median value into a vector with missing values

Usage

impute_median(x)

# S3 method for default impute_median(x)

# S3 method for factor impute_median(x)

Arguments

x

vector

Value

vector with median values replaced

Examples

Run this code
# NOT RUN {
vec <- rnorm(10)

vec[sample(1:10, 3)] <- NA

impute_median(vec)

# }

Run the code above in your browser using DataLab