netmap {netmap} | R Documentation |
netmap: Plot network
and igraph
objects on a sf
map
using ggplot2
Description
The netmap package extends the ggnetwork
package by providing functions to
plot networks, with vertices usually representing objects with a spatial
attribute (cities, regions, countries, users with location data attached etc.)
on a map, provided by a sf
object (which in turn is able to represent
more or less all spatial data available). Networks and maps need not have the
same set of elements: if they don't, only the intersection will be represented.
netmap functions
The main function is ggnetmap
, which produces a data.frame
that is then used as data
within ggplot2
calls. For those wishing
to use the plot.network
or the
plot.igraph
function to plot the network
(without overlaying it on an sf
object), both a custom layout function,
network.layout.extract_coordinates
, and a wrapper that provides
convenient manipulation of network
and sf
objects,
netmap_plot
, are available.