map | R Documentation |
A function that creates a plot of points on a background map pulled from Google Maps' API.
map(
x,
data = parent.frame(),
e,
scaleby,
size = 1,
col = "blue",
zoom = 10,
color,
...
)
x |
Function of the form latitude~longitude |
data |
Data frame containing latitude and longitude variables |
scaleby |
A variable for bubbles to be scaled by in a bubble plot. |
size |
Size of the points. Default is 1, larger numbers will make points larger. |
col |
A specification for the plotting color. Defaults to "blue". You
can provide any color name here, like "red", "purple", etc., in quotes. Or,
you could use hex values like "FF00FF", again in quotes. See section 'Color
Specification' in the |
dots |
graphical parameters to be passed to |
Creates a map using a Google Maps basemap, with points of data on top. Points can be colored differently and sized according to another variable
A map of points with a google map background
lat <- runif(10, 32, 42)
lon <- runif(10, -124, -114)
geodata <- data.frame(lat, lon)
scale <- sample(1:10, 10)
map(lat~lon, data=geodata)
map(lat~lon, data=geodata, scaleby = scale)
map(lat~lon, data=geodata, scaleby = scale, size = 5)
map(lat~lon, data=geodata, col = type)
map(lat~lon, data=geodata, scaleby = scale, col = type)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.