Skip to content

Instantly share code, notes, and snippets.

View somerealnumbers's full-sized avatar

Andrew Worsley somerealnumbers

View GitHub Profile
@somerealnumbers
somerealnumbers / tableau_shapefile_prep.R
Last active October 11, 2015 05:15
How to prepare an ESRI Shapefile for Visualisation in Tableau using R. Ethan Li, Andrew Worsley
require(rgdal)
require(ggplot2)
require(dplyr)
shapefile_prep = function(shape.path, shape.name){
# shape.path = file path to shapefile (character string)
# shape.name = name of shape file (character string)
# reading in the shapefile
ploygons.shp = readOGR(dsn = shape.path, layer = shape.name) %>%