Skip to content

Instantly share code, notes, and snippets.

View jadianes's full-sized avatar

Jose A Dianes jadianes

  • http://mosaic-tx.com
  • Cambridge, UK
View GitHub Profile
@lmullen
lmullen / shapefile.r
Last active January 26, 2022 22:07
How I use shapefiles in R with ggplot2 and RGDAL
library(rgdal) # R wrapper around GDAL/OGR
library(ggplot2) # for general plotting
library(ggmaps) # for fortifying shapefiles
# First read in the shapefile, using the path to the shapefile and the shapefile name minus the
# extension as arguments
shapefile <- readOGR("path/to/shapefile/", "name_of_shapefile")
# Next the shapefile has to be converted to a dataframe for use in ggplot2
shapefile_df <- fortify(shapefile)
@staltz
staltz / introrx.md
Last active July 26, 2024 04:24
The introduction to Reactive Programming you've been missing