I have a dataset named malt
, where one of the columns is named ka
. I want to replace NA
values in that ka
column by mean values in malt$ka
and other value remain as it is, so do this by if else
malt$ka <- ifelse(malt$ka=="NA", mean(malt$ka), "malt$AcqCostPercust")
This does not seem to work, and I am confused how to replace values the NA
values.