graph2sp: Convert a graph into Spatial objects

Description Usage Arguments Value

View source: R/graph2sp.R

Description

This function converts a graph (igraph) with geolocated vertices into Spatial objects (points and lines).

Usage

1
graph2sp(x, edges = c("lines", "gc", "arc"), alpha = 45)

Arguments

x

an igraph object with at least two vertices attributes "lon" and "lat" giving the longitude and the latitude of each vertex respectively.

edges

a character string giving the style to use for edges (lines connecting vertices). Can be one of "lines" for straight lines, "gc" for great circles or "arc" for user defined arcs.

alpha

if edges is set to "arc", a numeric giving the value of the central angle for the arcs.

Value

A list of two Spatial objects. A SpatialPointsDataFrame for the vertices and a SpatialLinesDataFrame for the edges.


Hackout2/epimap documentation built on May 6, 2019, 9:47 p.m.