Question:

Write a function in R language to replace the missing value in a vector with the mean of that vector.

Answer:

mean impute <- function(x) {x [is.na(x)] <- mean(x, na.rm = TRUE); x}


Keywords:

© 2017 QuizBucket.org