[R] latitude and longitude distribution

Jim Lemon jim at bitwrit.com.au
Tue Aug 25 14:13:26 CEST 2009


ogbos okike wrote:
> Good day to you all,
> I have lightning data containing date, time, latitude and longitude. I hope
> that distribution of latitude and longitude will give number of lightning
> occurrence in a region. I have used factor function to sum up the number of
> events on latitude and longitude axis and saved as x and y. But when I tried
> to plot the two, I had and error message ( Error in image.default(x, y, z) :
> increasing 'x' and 'y' values expected). Every other effort I made failed to
> be successful - please I am a new user of R. Part of the data I am using is:
>   
Hi Ogbos,
That's better. What may be more to your liking is this:

library(maps)
data(worldMapEnv)
map("world")
points(lightning$lon,lightning$lat,col="red")

Jim




More information about the R-help mailing list