Please enable JavaScript.
Coggle requires JavaScript to display documents.
Week 9 - Spatial Data Visualisation (More detail in plotting (Overplotting…
Week 9 - Spatial Data Visualisation
Why?
Capture
interesting patterns, trends & correlation
because of geographical information
Visualise
over space information
Describe
the significance of data by
placing it in a visual context (space)
ggmap
Visualising Data in Maps
Download map raster
function: geocode
obtain co-ords of a location
output = "more"
get additional information
function: revgeocode
convert lon & lat into an address
function: get_map
Arguments
zoom
maptype
location
x-axis is lon; y-axis is lat
Plot raster & overlay data
Plot the raster:
ggmap(myMap)
Add points with lat/lon co-ords:
ggmap(myMap) +
geom_point (aes(x=lon, y=lat),
data=data, alpha=.5,
color="darkred", size=3)
color = colour
size = size of points
alpha = transparency
More detail in plotting
Differentiating type of data,
binning, densities, faceting (facet_wrap)
Overplotting
Bin the points:
stat_bin2d
(heatmap)
Density plot
stat_density2d
Select subset of data
scale_size
:
scale to the size of the points
scale_color_gradientn
:
change colours of dots