Re: [R] world map matrix

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Fri, 08 Jun 2007 08:39:42 -0400

On 6/8/2007 6:52 AM, Antonio Rodríguez wrote:
> Hi,
>
> Is it possible to make a world map matrix where land values are set to 0 and
> sea values to 1?

It's not hard to produce a bitmap of a world map with the maps package, and then some image manipulation functions could convert it to 0's and 1's. I don't know if there's a more direct way.

One minor problem you may encounter is that the default world map display isn't really rectangular: e.g. bits of Siberia that cross 180 degrees east are still displayed attached to Siberia rather than wrapping around and being displayed on the other side of the map. The display also doesn't go all the way to the south pole. I produced a couple of rectangular bitmaps covering 90 south to 90 north and 180 west to 180 east; they're included in the rgl package (and used to display globes in the persp3d example).

Duncan Murdoch



R-help_at_stat.math.ethz.ch 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. Received on Fri 08 Jun 2007 - 12:43:40 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 08 Jun 2007 - 13:31:47 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.