Skip to content
Prev 343159 / 398513 Next

Generating a polygon around points

I've been struggling for half a day on what should be a simple problem...

I have a data frame of lat/long coordinates that describe a region, and I
want to draw a polygon around them so I can use that as a boundary (to be
thrown at INLA, but those details aren't important). The coordinates are
almost on a regular grid: there is some variation in latitude (because
we're on a globe).

If the coordinates were on a regular grid, I could use as.owin() to create
a mask, and go on from there (I have code that will work). But as.owin()
doesn't like unevenly spaced points.

Can anyone suggest a way to sort this out? Preferable without having to
mess around transforming the coordinates.

Bob