Skip to content

My functions used in the dissertation and elsewhere

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

baarthur/spatialops

Repository files navigation

spatialops

Lifecycle: experimental R-CMD-check

Spatialops: spatial operations that come in handy

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 with shp_extract_read
  • calculate the distance between the closest y feature from an x set of features with dist_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
  • ggplot quantile regression coefficients with coef_rqs

Installation

You can install the development version of spatialops with remotes:

remotes::install_github("https://github.com/baarthur/spatialops")

Example

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)

About

My functions used in the dissertation and elsewhere

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages