handleMissings function

Handle missing data in matrices.