impute_na: Impute missing value based on mean

impute_naR Documentation

Impute missing value based on mean

Description

impute_na is a function that takes a numeric vector x and it inserts the average value of the values on the right and left of the missing observations. If there is data on both sides a number is returned, if not NA.

Usage

impute_na(x)

Arguments

x

Numeric vector

Details

Used in scripts: Robust function: FALSE

Value

Returns x with inserted missing values if one or more of them have observations on both sides


AndreSjuve/dretools documentation built on Dec. 4, 2024, 3:12 a.m.