Session Ready
Exercise

Gridded predictions

Constructing the grid is the hard part done. You can now compute kriged estimates over the grid using the variogram model from before (v_model) and the grid of SpatialPixels.

Instructions
100 XP

The spatial pixel grid of the region, spgrid, and the variogram model of pH, v_model have been pre-defined.

  • Use kriging to predict pH in each grid rectangle throughout the study area.
    • Call krige().
    • The formula and input data are already specified.
    • Pass spgrid as the new data to predict.
    • Pass the variogram model to the model argument.
  • Calculate the probability of alkaline samples in each grid rectangle.
    • The mean of the predictions is the var1.pred element of ph_grid.
    • The variance of the predictions is the var1.var element of ph_grid. Take the square root to get the standard deviation.
  • Plot the alkalinity in each grid rectangle.
    • Call spplot().
    • Pass the alkalinity column to the zcol argument as a string.