I am struggling to plot points using WGS84 co-ordinates on a map of the UK using the OSGB 1936 / British National Grid CRS. I'm using the rgdal package in R.
Here is my reproducible example, using the co-ordinates of Buckingham Palace...
library(rgdal)
foo <- data.frame(lat = 51.500829, long = -0.142994)
bar <- SpatialPoints(foo)
proj4string(bar) <- CRS("+init=epsg:4326")
bar <- spTransform(bar, CRS("+init=epsg:27700"))
coordinates(bar)
This outputs the following transformed co-ordinates:
lat long
[1,] 7464126 -5554500
Where I should be getting latitude of 179622 and longitude of 528993.
Can anyone tell me what I'm doing wrong? The only similar problem I could find was here and I'm now pretty confident I am choosing the right CRSs. I'm trying to do something similar to this post but again, I don't think the solutions there can help me.
P.S. I'm using this site to check what co-ordinates I should be getting.