Learn R Programming

GADMTools (version 3.9-1)

isopleth: Draw an isopleth on selected regions

Description

Drawing an isopleth (also known as heat maps) with GADMTools is straightforward. You just have to select your shape(s) file(s) with gadm_loadcountries, load your data from a csv file for example, and call the isoopleth function with the right arguments.

Usage

isopleth(x, data, palette=NULL, title="", subtitle = "", caption = "")

Arguments

x

Object gadm_sp

data

data.frame - data to plot

palette

String - An RColorBrewer palette name or a String vector vector of colors. Default NULL.

title

String - Plot title. Default is an empty string.

subtitle

String - Plot subtitle. Default is an empty string.

caption

String - Plot caption. Default is an empty string.

Value

Object ggplot2

Examples

Run this code
# NOT RUN {
library(GADMTools)
data(Corsica)

longitude <- runif(6, min=8.74, max = 9.25)
latitude  <- runif(6, min=41.7, max = 42.6)
Cases <- runif(6, 25, 112)
DAT <- data.frame(longitude, latitude, Cases)

isopleth(Corsica, data = DAT, palette = "Blues")

# }

Run the code above in your browser using DataLab