netMap: Interactive network on a map

Description Usage Arguments Examples

View source: R/netMap.R

Description

This is a wrapping function to create interactive network on a map from an igraph object.

Usage

1
netMap(x, v.size = 5, v.col = 2, bm = "cartodb.darkmatter.nolab", ...)

Arguments

x

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

v.size

a numeric vector indicating vertices size.

v.col

a vector of R colors to use for the vertices.

bm

a character string giving the base map tiles server adress. Use bmSource to get a list of preconfigured servers.

...

additional arguments which can be passed to writeMap.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
require(igraph)
pump.adj <- as.matrix(dist(coordinates(cholera$pumps)))
pump.graph <- graph.adjacency(pump.adj < 0.003, diag = FALSE)
V(pump.graph)$lat <- coordinates(cholera$pumps)[, 2]
V(pump.graph)$lon <- coordinates(cholera$pumps)[, 1]
netMap(pump.graph, v.size = 5, width = 500, height = 300)

## End(Not run)

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