impute_median <-
function(ma, med){
ma <- t(apply(ma, 1, function(ma) ifelse(is.na(ma),
median(ma, na.rm = TRUE), ma)))
ma[is.na(rowSums(ma)) == TRUE,] <-
med[is.na(rowSums(ma)) == TRUE]
return(ma)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.