[R] Map of UK Counties - to use in R
Roger.Bivand at nhh.no
Thu Aug 13 12:37:04 CEST 2009
If your csv file has points, you can read into a data.frame using
df <- read.csv(<file name>)
in the usual way (watch the decimal sign and use read.csv2() if need be),
and coerce to a SpatialPointsDataFrame by saying
coordinates(df) <- c("long", "lat")
where "long", "lat" are the names of the data.frame columns with the
on the county boundary basemap will then display the points, your choice of
pch=. Do do summary(df) and check that your coordinates do fall inside the
county basemap! If west of Greenwich are large numbers <= 360, subtract 360
from all longitude values over 180 (untried, but does happen, so worth
If your csv file has extra data for the county entities, you'll need to
identify which are which in order to make thematic maps.
> Thanks a million Roger! This works well. All I now need to do is to figure
> how I can plot data from a csv file onto the map. I really appreciate your
> Roger Bivand wrote:
>> The illustration you show is for the so-called traditional or historical
>> counties of England, which may be available somewhere. There are
>> non-georeferenced PNG files on Wikipedia, which might be used, but as far
>> as I can see, only UK-based academics can register for access to the
>> edina UK borders datasets.
>> One possibility is to use the 2006 NUTS boundaries shapefile from
>> GISCO/EUROSTAT at:
>> and in R using something like:
>> RG <- readOGR(".", "NUTS_RG_03M_2006")
>> UK <- grep("^UK", RG$NUTS_ID)
>> RG_UK <- RG[UK,]
>> plot(RG_UK, axes=TRUE)
>> You'll then need to find the regions you want, possibly from:
>> so that you can retain only England, and choose the NUTS* boundaries that
>> suit your "counties" - which are not presently well-defined because of
>> boundary and administrative changes. The GISCO shapefile is in
>> geographical coordinates, so you'll be able to overplot points by
>> longitude and latitude.
>> Hope this helps,
>> Roger Bivand
>> Raoul wrote:
>>> Can anyone help me with either of these:
>>> 1) Map of the UK counties that I could use in R?
>>> 2) How could I use an existing map for example, a map from here
>>> http://www.itraveluk.co.uk/maps/england.html - in R. I need to use a UK
>>> map to plot locations on it by lat & long.
>>> Would appreciate help on any of these.
View this message in context: http://www.nabble.com/Map-of-UK-Counties---to-use-in-R-tp24930435p24952627.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help