Geospatial
Misc
- Packages
- {rgeoda} - Tools for Exploratory Spatial Data Analysis such as Spatial Cluster Detection and Clustering Analysis, Regionalization, etc.
- {GeoXp} (Vignette) - Interactive graphics for exploratory spatial data analysis
- Couples maps with Moran scatterplots, variogram clouds, Lorenz curves and other graphical tools
- Includes dimension reduction techniques such as principal components analysis and cluster analysis whose results are also linked to the map
- {GHRexplore} (website) - Exploratory Analysis of Temporal and Spatio-Temporal Health Data (Count Data)
- A collection of commonly used visualizations of temporal and spatio-temporal health data including case counts, incidence rates, and covariates.
- Nothing in the vignette seems to preclude using this package for count data that isn’t health related, especially for quick exploratory purposes.
- The available plot types include time series, heatmaps, seasonality plots, maps and more. The package supports standard data transformations such as temporal and spatial aggregations, while offering extensive customization options for the resulting figures.
- A collection of commonly used visualizations of temporal and spatio-temporal health data including case counts, incidence rates, and covariates.
Continuous Outcome
{ggmap} Dot map
Example: Does Price vary by location?
In your data, find the min and max latitude and longitude to specify a bounding box
library(ggmap) bbox <- c(left = min_longitude, bottom = min_latitude, right = max_longitude, top = max_latitude) map_tiles <- get_stamenmap(bbox, zoom = 13)(Optional) Aggregate some of the data (i.e. dots)
agg_dat <- dat %>% group_by(latitude = round(latitude, 2), longitude = round(longitude, 2)) %>% summarize(avg_outcome = mean(numeric_outcome), n = n())scale_size_continuousadjusts the range of dot sizes. This range makes them a little smaller.
.png)
ggmap(map_tiles) + geom_point(aes(longitude, latitude, size = n, color = avg_outcome), data = agg_dat) + scale_color_gradient2(low = "blue", high = "red", midpoint = midpoint_value_of_numeric_outcome, trans = "log10", labels = dollar) + scale_size_continuous(range = c(0.5, 4)) + theme_map() + labs(color = "avg_outcome", size = "n")- trans and labels are for the legend (I think).