preProcess: make medianImpute work with data matrix as well as data frames