rgl.Map {TeachingDemos}R Documentation

Plot a map in an rgl window

Description

Plots a map (from a Map object from package spData) on a unit sphere in an rgl window that can then be interactively rotated.

Usage

rgl.Map(Map, which, ...)

Arguments

Map

An sfc_MULTIPOLYGON object

which

Vector indicating the subset of polygons to plot.

...

Additional arguments passed on to rgl.lines.

Details

This assumes that the map is cordinates in degrees and plots the map on a unit sphere in an rgl window making a globe. You can then rotate the globe by clicking and dragging in the window.

Value

There is no return value, this function is run for its side effect.

Note

This function is still beta level software (some extra lines show up).

Author(s)

Greg Snow 538280@gmail.com

See Also

rgl in package rgl, plot method in package sp

Examples

if(interactive()){

if(require("spData")) {
  data(world)
  rgl.Map(world$geom)
  spheres3d(0,0,0,.999, col='lightblue')
}
}

[Package TeachingDemos version 2.13 Index]