Session Ready
Exercise

Auto-kriging at point locations

The autoKrige() function in the automap package computes binned variograms, fits models, does model selection, and performs kriging by making multiple calls to the gstat functions you used previously. It can be a great time-saver but you should always check the results carefully.

In this example you will get predictions at the missing data locations.

autoKrige() can try several variogram model types. In the example, you'll use a Matern variogram model, which is commonly used in soil and forestry analyses. You can see a complete list of available models by calling vgm() with no arguments.

Instructions
100 XP

The acidity survey data, ca_geo, and the missing value index, miss, have been pre-defined.

  • Call autoKrige() to automatically run a kriging model.
    • Set the formula for modeling acidity versus the position, as before.
    • The input_data is the non-missing data from the survey.
    • The new_data is the missing data from the survey.
    • Set the model to "Mat". (Note the capital M.)
    • Assign the result to ph_auto.
  • Call plot() on ph_auto to see the results.