ggmap: Spatial Visualization with ggplot2
ggmap: Spatial Visualization with ggplot2 by David Kahle and Hadley Wickham. Abstract In spatial statistics the ability to visualize data and models
ggmap quickstart
There are 2 basic steps to making a map using ggmap: Part 1: Download map raster. Part 2: Plot raster and overlay data. Start by loading the package:
ggmap.pdf
5 Feb 2019 Package 'ggmap'. February 5 2019. Version 3.0.0. Title Spatial Visualization with ggplot2. Description A collection of functions to ...
Introduction to visualising spatial data in R
In this tutorial we will use the following packages: • ggmap: extends the plotting package ggplot2 for maps. • rgdal: R's interface to the popular C/C++
Package ggmap
6 Sept 2012 Description ggmap allows for the easy visualization of spatial data and mod- els on top of Google Maps OpenStreetMaps
Geospatial Data in R
ggmap with polygons ggmap(gm)+geom_polygon( aes(fill=Population group=id
Ggmap Package R
Download Ebook Ggmap. Package R. R Tutorial: Useful get_map() and ggmap() options de DataCamp il y a 1 an 2 minutes et 43 secondes 2.
Introduction to visualising spatial data in R
In this tutorial we will use: • ggmap: extends the plotting package ggplot2 for maps. • rgdal: R's interface to the popular C/C++ spatial data processing
Using R packages tmap raster and ggmap for cartographic
13 Jan 2021 Using R packages 'tmap' 'raster' and 'ggmap' for cartographic visualization: An example of dem-based terrain modelling of Italy
Darryl Mcleod
In this tutorial we will use the following packages: • ggmap: extends the plotting package ggplot2 for maps. • rgdal: R's interface to the popular C/C++
Package 'ggmap"
March 14, 2023
Version3.0.2
TitleSpatial Visualization with ggplot2
DescriptionA collection of functions to visualize spatial data and models on top of static maps from various online sources (e.g Google Maps and Stamen Maps). It includes tools common to those tasks, including functions for geolocation and routing.URLhttps://github.com/dkahle/ggmap
DependsR (>= 3.1.0), ggplot2 (>= 2.2.0)
ImportsRgoogleMaps, png, plyr, jpeg, digest, scales, dplyr, bitops, grid, glue, httr, stringr, purrr, magrittr, tibble, tidyr, rlang, cliSuggestsMASS, hexbin, testthat
LicenseGPL-2
LazyDatatrue
RoxygenNote7.2.1
EncodingUTF-8
NeedsCompilationno
AuthorDavid Kahle [aut, cre] (Scott Jackson [aut],
Mikko Korpela [ctb]
MaintainerDavid Kahle
RepositoryCRAN
Date/Publication2023-03-14 18:10:06 UTC
Rtopics documented:
bb2bbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 calc_zoom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 12bb2bbox
crime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 geocode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 geom_leg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 get_cloudmademap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 get_googlemap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 get_map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 get_navermap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 get_openstreetmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 get_stamenmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21ggimage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
gglocator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
ggmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
ggmap-defunct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
ggmapplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
ggmap_options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
hadley . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
inset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
inset_raster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
legs2route . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
LonLat2XY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
make_bbox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
mapdist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
OSM_scale_lookup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
print.ggmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
qmap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
qmplot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
register_google . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
revgeocode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
route . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
theme_inset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
theme_nothing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
trek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
wind . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
XY2LonLat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
zips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Index69bb2bboxConvert a bb specification to a bbox specificationDescription In ggmap, all maps (class ggmap) have the bb attribute, a data frame bounding box specification in terms of the bottom left and top right points of the spatial extent. This function converts this specification to a named double vector (with names left, bottom, right, top) specification that is used in some querying functions (e.g. get_stamenmap). bb2bbox3 Usage bb2bbox(bb)
Arguments
bba bounding box in bb format (see examples) Value a bounding box in bbox format (see examples)Author(s)
David Kahle
Examples
## Not run: # cut down on R CMD check time # grab a center/zoom map and compute its bounding box gc <- geocode("white house, washington dc") map <- get_map(gc) (bb <- attr(map, "bb")) (bbox <- bb2bbox(bb)) # use the bounding box to get a stamen map stamMap <- get_stamenmap(bbox) ggmap(map) + geom_point( aes(x = lon, y = lat), data = gc, colour = "red", size = 3 ggmap(stamMap) + geom_point( aes(x = lon, y = lat), data = gc, colour = "red", size = 3 ## End(Not run)4calc_zoomcalc_zoomCalculate a zoom given a bounding boxDescription
calc_zoom can calculate a zoom based on either (1) a data frame with longitude and latitude vari- ables, (2) a longitude range and latitude range, or (3) a bounding box (bbox specification). Thespecification for (1) is identical to that of most R functions, for (2) simply put in a longitude range
into lon and a latitude range into lat, and for (3) put the bounding box in for the lon argument. Usage calc_zoom(lon, lat, data, adjust = 0, f = 0.05)Arguments
lonlongitude, see details latlatitude, see details data(optional) a data frame containing lon and lat as variables adjustnumber to add to the calculated zoom fargument to pass to make_bboxSee Also
make_bbox(),bb2bbox()Examples
# From data calc_zoom(lon, lat, wind) # From range lon_range <- extendrange( wind$lon ) lat_range <- extendrange( wind$lat ) calc_zoom(lon_range, lat_range) # From bounding box box <- make_bbox(lon, lat, data = crime) calc_zoom(box) crime5crimeCrime dataDescription Lightly cleaned Houston crime from January 2010 to August 2010 geocoded with Google MapsAuthor(s)
Houston Police Department, City of Houston
References
Geocodes (finds latitude and longitude of) a location using the Google Geocoding API. Note: To use Google"s Geocoding API, you must first enable the API in the Google Cloud Platform Console.Seeregister_google().
Usage geocode( location, output = c("latlon", "latlona", "more", "all"), source = c("google", "dsk"), force = ifelse(source == "dsk", FALSE, TRUE), urlonly = FALSE, override_limit = FALSE, nameType = c("long", "short"), ext = "com", inject = "", mutate_geocode(data, location, ...) geocodeQueryCheck() geocode_cache()6geocode
write_geocode_cache(path, ...) load_geocode_cache(path, overwrite = FALSE) clear_geocode_cache(path)Arguments
locationacharactervectorofstreetaddressesorplacenames(e.g."1600 pennsylvania avenue, washington dc" or "Baylor University")
outputamount of output,"latlon","latlona","more", or"all" source"google" for Google (note: "dsk" is defunct) forceforce online query even if cached. urlonlyreturn only the url? override_limitoverride the current query rate nameTypein somecases, Googlereturns both along name and ashort name. this parameter allows the user to specify which to grab. exttop level domain (e.g. "com", "co.nz"); helpful for non-US users injectcharacter string to add to the url or named character vector of key-value pairs to be injected (e.g. c("a" = "b") get converted to "a=b" and appended to the query) ...Inmutate_geocode(), argumentstopasstogeocode(). Inwrite_geocode_cache(), arguments to pass tosaveRDS(). dataa data frame or equivalent pathpath to file overwriteinload_geocode_cache(), should the current cache be wholly replaced with the one on file?Details
Note:geocode()uses Google"s Geocoding API to geocode addresses. Please take care not to disclose sensitive information.https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8972108/ suggest various alternative options for such data. Value Ifoutputis"latlon","latlona", or"more", a tibble (classed data frame). If"all", a list.Author(s)
David Kahle
See Also
articles/PMC8972108/ geocode7Examples
## Not run: requires Google API key, see ?register_google ## basic usage # geocoding is most commonly used for addresses geocode("1600 Amphitheatre Parkway, Mountain View, CA") geocode("1600 Amphitheatre Parkway, Mountain View, CA", urlonly = TRUE) # google can also geocode colloquial names of places geocode("the white house") # geocode can also accept character vectors of places geocode(c("the white house", "washington dc")) ## types of output geocode("waco texas") geocode("waco texas", output = "latlona") geocode("waco texas", output = "more") str(geocode("waco texas", output = "all")) geocode(c("waco, texas", "houston, texas")) geocode(c("waco, texas", "houston, texas"), output = "latlona") geocode(c("waco, texas", "houston, texas"), output = "all") %>% str(4) ## mutate_geocode # mutate_geocode is used to add location columns to an existing dataset # that has location information df <- data.frame( address = c("1600 Pennsylvania Avenue, Washington DC", "", "houston texas"), stringsAsFactors = FALSE mutate_geocode(df, address) df %>% mutate_geocode(address) ## known issues # in some cases geocode finds several locations8geom_leg
## End(Not run)geom_legSingle line segments with rounded endsDescription This is ggplot2"s segment with rounded ends. It"s mainly included in ggmap for historical reasons. Usage geom_leg( mapping = NULL, data = NULL, stat = "identity", position = "identity", arrow = NULL, lineend = "round", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE,Arguments
mappingSetofaestheticmappingscreatedbyaes()oraes_(). Ifspecifiedandinherit.aes = TRUE(the default), it is combined with the default mapping at the top level of the plot. You must supplymappingif there is no plot mapping. dataThe data to be displayed in this layer. There are three options: IfNULL, the default, the data is inherited from the plot data as specified in the call toggplot(). Adata.frame, or other object, will override the plot data. All objects will be fortified to produce a data frame. Seefortify()for which variables will be created. Afunctionwill be called with a single argument, the plot data. The return value must be adata.frame, and will be used as the layer data. Afunction can be created from aformula(e.g.~ head(.x, 10)). statThe statistical transformation to use on the data for this layer, as a string. positionPosition adjustment, either as a string, or the result of a call to a position adjust- ment function. geom_leg9 arrowspecification for arrow heads, as created by arrow(). lineendLine end style (round, butt, square). na.rmIfFALSE, the default, missing values are removed with a warning. IfTRUE, missing values are silently removed. show.legendlogical. Should this layer be included in the legends?NA, the default, includes if any aesthetics are mapped.FALSEnever includes, andTRUEalways includes. It can also be a named logical vector to finely select the aesthetics to display. inherit.aesIfFALSE, overrides the default aesthetics, rather than combining with them. This is most useful for helper functions that define both data and aesthetics and shouldn"t inherit behaviour from the default plot specification, e.g.borders(). ...Other arguments passed on tolayer(). These are often aesthetics, used to set an aesthetic to a fixed value, likecolour = "red"orsize = 3. They may also be parameters to the paired geom/stat.quotesdbs_dbs1.pdfusesText_1[PDF] ghid pentru bacalaureat de nota 10 la biologie clasele xi-xii pdf
[PDF] gia algerie
[PDF] gia ca phê hôm nay
[PDF] gia ca thi truong
[PDF] gia certificat
[PDF] gia diamond
[PDF] gia gemmologie
[PDF] gia mannequin
[PDF] gia model
[PDF] gia movie
[PDF] giant 2017 route
[PDF] giant 2017 tcr advanced
[PDF] giant 2017 vtt
[PDF] giant editor francais