Built mainly upon the {sf}
and {tidyverse}
frameworks, the functions in this package range from simple reading/tidying wrappers to specific spatial operations and random utilities I have used along my journey. Some use cases:
- read shapefiles directly from a
.zip
whithout creating a mess in your folders withshp_extract_read
- calculate the distance between the closest
y
feature from anx
set of features withdist_nearest
- need to manually tidy your shapefiles (e.g. nudge a geometry)? No problem, load them into MapHub and then convert the description into useful columns using
maphub_to_sf
gg
plot quantile regression coefficients withcoef_rqs
You can install the development version of spatialops with remotes
:
remotes::install_github("https://github.com/baarthur/spatialops")
Find the distance to the closest subway station in each neighborhood in Fortaleza (Brazil). Very useful in hedonic models and other (spatial) econometric analysis.
library(spatialops)
data("fortaleza")
data("metrofor")
# select only stations
metrofor <- dplyr::filter(metrofor, railway == "station")
fortaleza <- fortaleza %>%
dist_nearest(metrofor, name = dist_metro)