This a function to handle missing values in a numeric dataframe column. It fills empty/missing rows values with the average numeric value rounded to the minimum number of decimal places in the input data.

AOCF(x)

Arguments

x

data series/vector with missing values to fill (vector)

Value

returns the same data series with missing values filled in with the average numeric value

Examples

AOCF(c(NA, 2.230, 1.1, 2390.141, NA, 1341.012, 10.24))
#> [,1] #> [1,] 748.9 #> [2,] 2.2 #> [3,] 1.1 #> [4,] 2390.1 #> [5,] 748.9 #> [6,] 1341.0 #> [7,] 10.2