1

I am trying to fit a model using regression kriging using r gstat package. I have loaded some disease data called prevalence and some covariate rainfall. The rainfall raster data is loaded as a .grd file.The code that I am using to fit this model is

m = fit.gstatModel(prevalence, Prevalence~rainfall,rainfall, family = poisson())

The error result am getting is

Error in (function (classes, fdef, mtable)  :   unable to find an inherited method for function ‘fit.gstatModel’ for signature ‘"data.frame", "formula", "RasterLayer"’

could anyone help?

Paulo
  • 41
  • 1
  • 5
  • you should provide a reproducible (dataset and code) example that replicate the error. – MLavoie Jan 01 '16 at 10:48
  • The function was not written for a `RasterLayer`. Start with `r <- as(rainfall, 'SpatialGridDataFrame')`, replace `rainfall` with `r` and go from there – Robert Hijmans Jan 02 '16 at 00:42

0 Answers0