]> git.vanrenterghem.biz Git - R/project-wa-schools.git/commitdiff
Load needed broom library and suppress tidy warning.
authorFrederik Vanrenterghem <frederik@vanrenterghem.biz>
Thu, 12 Oct 2017 11:44:06 +0000 (19:44 +0800)
committerFrederik Vanrenterghem <frederik@vanrenterghem.biz>
Thu, 12 Oct 2017 11:44:06 +0000 (19:44 +0800)
WA_active_schools.R

index 779249683540b607845fc964374d8f041a828b72..394fa831bce70794f1eceabb20f44dfb7b9394eb 100644 (file)
@@ -2,13 +2,15 @@
 #install.packages("rgdal")
 library(rgdal)
 library(tidyverse)
+library(broom)
 #install.packages("OpenStreetMap")
 library(OpenStreetMap)
 library(viridis)
 
 # Read the shapefile obtained from WA opendata (SLIP)
 shape <- readOGR(dsn = "data/", layer = "CurrentActiveSchoolsSemester12017_PublicDET_014")
-shape.df <- tidy(shape)
+# Suppress warning about no method existing for SpatialPointsDataframe - TODO use library sf
+shape.df <- suppressWarnings(tidy(shape))
 shape.df$latitude <- as.numeric(as.character(shape.df$latitude))
 shape.df$longitude <- as.numeric(as.character(shape.df$longitude))
 shape.df$totalschoo <- as.numeric(as.character(shape.df$totalschoo))