[R-sig-Geo] Creating a Grid out of a matrix of coordinates

Paul Hiemstra p.hiemstra at geo.uu.nl
Fri Aug 21 21:34:02 CEST 2009


Hi,

If your object's points are regularly spaced and in a SpatialPoints 
object, use:

gridded(myobj) = TRUE

Or you can from a data.frame with the coordinates and attributes to a 
grid by:

coordinates(myobj) = ~x+y
gridded(myobj) = TRUE

or shorthand:

gridded(myobj) = ~x+y

cheers,
Paul

Mehdi Khan schreef:
> Hello, I have a matrix 1.5 million rows long..
>
> wald:
>
>  coordinates  V3
> 1  (-124.996, 42.0458) 150
> 2  (-124.987, 42.0458) 150
> 3  (-124.979, 42.0458) 150
> 4  (-124.971, 42.0458) 150
> 5  (-124.963, 42.0458) 150
> 6  (-124.954, 42.0458) 150
> 7  (-124.946, 42.0458) 150
> 8  (-124.938, 42.0458) 150
> 9  (-124.929, 42.0458) 150
> 10 (-124.921, 42.0458) 150
>   
>
>
> I would like to coerce this into a grid object so that I can overlay points
> onto it.  How exactly could I accomplish that?  Thank you!!
>
> Mehdi Khan
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list