Learn R Programming

ggmap (version 0.7)

ggmap: Grab a map.

Description

Grab a map.

Usage

ggmap(location="houston", center=c(lat = 29.7632836, lon = -95.3632715), regularize=TRUE,
    type=c("color", "bw"), rgbcoefs=c(0, 1, 0), zoom=10, maptype="terrain", source=c("google",
    "osm"), verbose=FALSE, destfile="ggmapTemp.jpg", n_pix=640, scale=20000, ...)

Arguments

location
a character string containing the name of the location of interest
center
named numeric vector of latitude and longitude specifying the center of the image
regularize
logical; should the map grid be regularized?
type
'color' for a color map, 'bw' for a black and white map
rgbcoefs
when 'bw' is specified, conversions coefficients to use. see ?ReadImages::rgb2grey
zoom
level of zoom, an integer 0 (whole world) to 19 (higest zoom), default value 10
maptype
any of 'roadmap', 'mobile', 'satellite', 'terrain', 'hybrid', 'mapmaker-roadmap', 'mapmaker-hybrid'
source
'google' or 'osm' (OpenStreetMaps)
verbose
logical; should function message user?
destfile
character; name of file to save downloaded map
n_pix
numeric; number of pixels in map
scale
numeric; scale of OpenStreetMap, see ?GetMap
...
...

Value

  • a data.frame with columns latitude, longitude, and fill

Details

ggmap is a smart function which queries the Google Maps server or OpenStreetMap server for a map at a certain location at a certain spatial zoom.

See Also

ggmapplot, GetMap in package RgoogleMaps

Examples

Run this code
WashingtonMap_df <- ggmap(location = 'washington')
str(WashingtonMap_df)
# ggmapplot(WashingtonMap_df)}

Run the code above in your browser using DataLab