I want to replace NAs present in a column of a DATA TABLE with the mean of the same column. I am doing the following. But it is not working.
ww <- data.ta
na.aggregate in the zoo package replaces NAs with the mean of the non-NAs in the same column:
na.aggregate
library(zoo) ww[, Sepal.Length := na.aggregate(Sepal.Length)]