[R-sig-Geo] adding mask to spline raster

Robert J. Hijmans r.hijmans at gmail.com
Thu Jan 15 19:21:47 CET 2015


Hi Pascal,

On Wed, Jan 14, 2015 at 11:52 AM, Pascal Title <ptitle at umich.edu> wrote:
> Hi,
>
> I am creating interpolations of global marine diversity via thin plate
> splines, using the interpolate() function in the raster package. The
> problem I am having is that if I plot the spline interpolation and then
> overlay the plot with a continents polygon, it becomes clear that certain
> areas are interpolated as having high diversity where they shouldn't due to
> the configurations of continents, and the interpolation continuing "under"
> the continents.
>
> Is there any way to provide a mask either as a raster or as a spatial
> polygon to the interpolate function?

No, because you would need to change how you fit your model (Tps), not
how you make predictions with the model (interpolate).

I assume the seeping happens in Central America; you could make two
overlapping separate models: one for the east (Atlantic), and one for
the west (Pacific).

I think there is also some work on using 'soapy' GAMs to interpolate
values "around" islands that might be helpful here.

Robert

>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list