Description Usage Arguments Details Value Examples
Map geographic locations as points colored by values.
1 2 3 |
x |
data.frame of observations. |
field |
character, name of column in |
name |
character, name for color scale. |
title |
character, main title. |
alpha |
numeric vector, values used for relative alpha transparency. |
sizept, sizetxt |
numeric, relative size for points and text. |
xlim |
numeric vector, x limits (longitude in decimal degrees). |
ylim |
numeric vector, y limits (latitude in decimal degrees). |
bg |
character, background fill for land area (defaults to transparent). |
colorscale |
character, one of |
midval |
numeric, value at color scale midpoint when colorscale = 'bw2'. |
... |
further arguments passed to ggplot2 color scales (for example, transformations). |
Plot continuous or discrete values mapped across regions of North America.
Returns or plots an object inheriting from class 'ggplot'
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # iris data
set.seed(1959)
x <- iris[,1:3]
n <- NROW(x)
# add geographic structure
x <- data.frame(
x,
lon = seq(-80,-120,len=n) + rnorm(n,0,2),
lat = seq(30,45,len=n) + rnorm(n,0,2),
Sepal.Big = as.factor(ifelse(x$Sepal.Length > 6,1,0)))
(mmap(x, 'Sepal.Length', alpha=1, name='Sepal length'))
(mmap(x, 'Sepal.Length', alpha=1, name='Sepal length',
colorscale='inferno'))
(mmap(x, 'Sepal.Big', name='Sepal > 6 mm'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.