SyntaxFix
Write A Post
Hire A Developer
Questions
Go simply with Zoo, it will simply replace all NA values with mean of the column values:
library(zoo) na.aggregate(data)