Inverse Distance Weighting and Kriging in R

I posted a few months ago about a new R package I wrote with Filipe Matias– it’s available for download on GitHub. Last week we extended the GitHub tutorial to include interpolation methods and raster visualization/mapping example code.

Spatially Challenged readers have asked me to write tutorials on these techniques before, but I had been putting it off for a variety of reasons (embarrassment about my wordy coding style and lack of example datasets I could share being the two big ones). Adding this tutorial into the already-written cleanRfield tutorial helped me overcome some of those barriers and was exactly the push I needed.

A screenshot from the cleanRfield GitHub tutorial that includes example code for visualizing a kriged map and a yellow and green interpolated yield map.
A screenshot from the cleanRfield GitHub tutorial for making maps after kriging.

Even if you aren’t a cleanRfield user or need to interpolate point data that isn’t a yield map, the IDW and kriging example code (section 13 on the cleanRfield GitHub tutorial) is a great resource for getting started with interpolation in R. We took the time to include fundamentals of variograms and some interpretation guidelines, and the code for making maps is a great introduction for visualizing raster data in an R environment.

If you’re interested in interpolating using a point-and-click software instead of R, SAGA is a great choice. I have a blog post on inverse distance weighting in SAGA and another on interpolating via geographically weighted regression. SAGA can also be used for kriging, and while I do not have a tutorial for that topic, if you understand the menus from IDW and GWR in SAGA the kriging procedure is very straightforward. QGIS or ArcMap also have user friendly interpolation functionality, although sticking with R or SAGA usually makes more sense for my workflows.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s