I have found a lot of questions about conversions of Northings/Eastings to Longitude/Latitude in R. I have been working with this tutorial from Alex Singleton which is really useful in explaining the process and giving sample code. I have adapted the code for my own CSV file, and worked through the steps. My issue is, when i plot the data onto the map, it plots accurately in relation to each other, but does not plot over Northern Ireland, instead plots relational to eachother, but floating over wales.
Is there a simple fix for this to shift the plot?
setwd("~/R/maps") ukgrid = "+init=epsg:27700" latlong = "+init=epsg:4326" holes <- read.csv("Pothole_Enquiries_2016.csv", header = TRUE) map <- readRDS("GBR_adm2.rds") plot(map, col = 'grey', border = 'darkgrey') holes <- subset(holes, select = c("EASTING","NORTHING")) holes$holes_ID <- 1:nrow(holes) coords <- cbind(EASTING = as.numeric(as.character(holes$EASTING)),NORTHING = as.numeric(as.character(holes$NORTHING))) holes_SP <- SpatialPointsDataFrame(coords, data = data.frame(holes$holes_ID), proj4string = CRS("+init=epsg:27700") holes_SP_LL <- spTransform(holes_SP, CRS(latlong)) points(holes_SP_LL,col=2,pch=18)
I am presuming that this is something to do with the UKGrid codes, but i have only started to use spatial plots so this is a little new to me.