Plotting on the sphere in R
To begin with a caveat, most data I generally prefer not to view on a sphere, including much geographical information. It’s confusing, and half of the surface is completely obscured from view (though I’m more concerned about the half that’s not!). Of course, it really depends on what one is trying to accomplish or convey. End caveat. Below I have provided some example graphics of plotting on spherical surfaces in R. Earth is not spherical, but close enough, and our globe makes for a more interesting illustration.
Data in the map surface come from the
rworldmap package. I used
rworldxtra for convenient access to a higher resolution map layer on which the choropleth polygon colors are assigned. The plots below are a standard terrain image, and a bathymetry data matrix from NOAA, accessed via the
marmap package. I added noticeable overlays of major river systems on the last globe using the river data in the
Later I will share some plots where data is added to the 3D surface. Technically the choropleth plot shows aerial-type spatial statistics, in the form of country polygons, which could have been plotted on top of one of the other maps, but I am referring to the addition of lines, points, text, things often added secondarily in all our typical flat plots.