Remove setMinMax calls for speed.
Comment typo.
Avoid creating extra dataframe when predicting K.all.

Can just use the raster::predict function on the slope RasterLayer that is already in memory.
Don't calculate unused allcoef value. Return sampleindices.