0

I have a data.frame consisting of a points with an associated continuos value and their X,Y coordinates. Altough it's not stored anywhere it's projection is a Lambert conformal conic. I think this is why when I try to make it a raster object:

rast <- raster(dataframe)

I get the following error:

Error en .local(x, ...) : data are not on a regular grid

How can I tackle this issue?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
JEquihua
  • 1,087
  • 15
  • 30

1 Answers1

3

This particular function does require a regularly spaced set of points. The error message is reporting that there are gaps in your data and it's not able to interpolate between the existing points to provide the value for the missing points.

You need to see if R has a different rasterizing function that will interpolate to fill in the gaps, or find some other way to convert your data to a regular grid.

mkennedy
  • 18,916
  • 2
  • 38
  • 60