Areal interpolation is the process making estimates from a source set of polygons to an overlapping but incongruent set of target polygons. One challenge with areal interpolation is that, while the processes themselves are well documented in the academic literature, implementing them often involves “reinventing the wheel.” While the R
package sf
does offer a basic interface for areal weighted interpolation (st_interpolate_aw
), it lacks some features that we use in our work. The areal
package contains a suite tools for validation and estimation, providing a full-featured workflow that fits into both modern data management (e.g. tidyverse
) and spatial data (e.g. sf
) frameworks.
There are two additional bug fixes in v0.1.4:
areal
from GitHub.The initial CRAN release contains four known bugs (see Issues 6, 7, 14, and 16), all of which are fixed on the current GitHub master branch:
tid
and sid
column names are identical, the interpolated column created by aw_interpolate()
will consist of all NA
values. The simplest workaround is to rename either tid
or sid
before executing aw_interpolate()
. Alternatively, you can install the development version of areal
from GitHub.sf
geometries will result in geometry collections being created. This appears to be an infrequent issue, but it will result in an error when aw_interpolate()
is executed. The error will begin with Warning in st_cast.GEOMETRYCOLLECTION(X[[i]], ...)
. The simplest workaround is to install the development version of areal
from GitHub.sf
geometry column is not named geometry
. The simplest workaround is to either rename the column to geometry
before executing aw_interpolate()
. Alternatively, you can install the development version of areal
from GitHub.output = "tibble"
only returns the identification number and the estimated value. If you want other variables from the target data, the simplest workaround is to join the output to the original target data. Alternatively, you can install the development version of areal
from GitHub.Big thanks to early adopter Matt Herman for catching the first two and David Blodgett for catching the third!
If the sf
package is already installed, the easiest way to get areal
is to install it from CRAN:
Alternatively, the development version of areal
can be accessed from GitHub with remotes
:
Additional details, including some tips for installing sf
, can be found in the Get started article.
In addition to instructions for installation, the main Get started article has:
aw_interpolate()
function,areal
package’s development roadmap!This site also offers dedicated articles on data preparation and using areal
for areal weighted interpolation.