[R] Plotting function image

ilai keren at math.montana.edu
Wed Feb 15 00:10:27 CET 2012


In the absence of data

coords <- expand.grid(lat=1:5,long=1:5)
coords$z <- rnorm(25)
Coords<- unstack(coords,z~long)
image(as.matrix(Coords))


On Tue, Feb 14, 2012 at 10:36 AM, uday <uday_143_4u at hotmail.com> wrote:
> I have some data set which has latitude, longitude and Z values.
> I would like to plot them on global map.
> I am thinking to use image
> image(x, y, z, zlim, xlim, ylim, col = heat.colors(12),
>      add = FALSE, xaxs = "i", yaxs = "i", xlab, ylab,
>      breaks, oldstyle = FALSE, useRaster = FALSE, ...)
>
> here I have x = longitude
>                       y= latitude
>                      z = z
>
> but z suppose to be matrix but my z values are  single array , could
> somebody please tell me how to convert these single array of z to matrix ?
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Plotting-function-image-tp4387796p4387796.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list