Skip to content

Hackout2/epimap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

epimap

Description

A set of functions to quickly and easily create interactive maps based on Leaflet. Designed to work with mapData via sp objects. Also implements some functions to convert more complex objects (like contourlines, graphs, ...) into sp object.

Install

To install the package you can use devtools. You also need to install rleafmap.

devtools::install_github("fkeck/rleafmap")
devtools::install_github("Hackout2/epimap")

Demo

First, load the package and the cholera dataset.

library(epimap)
data(cholera)

The package provides a collection of simple *Map functions to easily get interactive maps.

quickMap

You can use quickMap to quickly represent points and polygons and set colors and sizes using a column of the dataframe linked to the sp object.

quickMap(cholera$deaths, col.by="Count", size.by="Count")

quickmap

heatMap

You can use the heatMap function to get an heat map (raster image and/or contour lines) from a SpatialGridDataFrame.

heatMap(cholera$deaths.den)

heatmap

netMap

You can use netMap to map spatial networks from an igraph object. For example we can create a network of pumps in Snow's London by connecting pumps which are geographically close. Note that you need to set explicitly geographical coordinates to the graph vertices with the lat and lon attributes.

library(igraph)
library(sp)

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)

netmap

Releases

No releases published

Packages

No packages published

Languages