Envirometrix / landmap

Landmap package for R
45 stars 13 forks source link

Example of how to use predictionLocations argument in predict()? #8

Open jpgannon opened 3 months ago

jpgannon commented 3 months ago

Can you provide an example of how to use the predictionLocation argument in predict() with an object from train.splearner?

A reproducible version of the issues I am having is below using the meuse demo...

demo(meuse) m <- train.spLearner(meuse["zinc"], covariates=meuse.grid[,c("dist","ffreq")], lambda = 1)

predict(m, predictionLocations = meuse.grid) returns: Error in [.data.frame(predictionLocations@data, , object@spModel$features) : undefined columns selected

predict(m, predictionLocations = meuse.grid[,c("dist","ffreq")]) returns: Error in [.data.frame(predictionLocations@data, , object@spModel$features) : undefined columns selected