[R-sig-Geo] Generic mapping tools

Robert J. Hijmans r.hijmans at gmail.com
Tue Aug 25 20:10:27 CEST 2009


Ogbos,

You could have a look at pointsToRaster in the raster package to count
the number of points (events?) per raster cell.

to install raster:
install.packages("raster", repos="http://R-Forge.R-project.org")

Robert

On Tue, Aug 25, 2009 at 10:56 AM, ogbos okike<ogbos.okike at gmail.com> wrote:
> Hello to everybody,
>
> I have a huge geographic data labeled latitude and longitude (global).  I am
> attempting to use Generic mapping tools to plot the distribution of the
> events. I wish to obtain number of events per region on the map. Using
> factor function, I have summed up the number of events on each block of
> latitude and longitude and saved them respectively as x and y. I hoped I
> could plot the matrix x and y by using color plot. But when I used >image(x,
> y), the error message was   "Error in image.default(y, x) : increasing 'x'
> and 'y' values expected".
>
> I am learning R for the first time and I am not quite sure that my method
> here is alright. I have just subscribed to this mailing list today so as to
> get help.
>
> I would therefore be grateful if you could guide me.
>  Small portion of the data is:
>  lat          lon
> -5.1821 147.4462
> -5.1826 147.3733
> -5.1680 147.3855
> 31.4489 -63.2175
> 28.3199 -62.1831
> -18.2495 -44.6471
> -11.3654 -42.8249
> -2.6652 -73.2344
> -13.3543 -56.5338
> 27.9594 -157.9413
> 29.4454 -62.0620
> -5.1953 116.0678
> 31.7057 -62.7211
> -15.6194 124.6710
> -7.1434 -72.2230
> -19.1066 -45.665
>
> Thank you
> Ogbos
>
>        [[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