Map of Europe at NUTS 2 Level

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Map of Europe at NUTS 2 Level

Miluji Sb
Dear all.

I would like to draw a map of France, Italy, Spain, and Portugal at NUTS 2
level. I used the following code:

library(“rgdal”)
library(“RColorBrewer”)
library(“classInt”)
#library(“SmarterPoland”)
library(fields)

# Download Administrative Level data from EuroStat
temp <- tempfile(fileext = ".zip")
download.file("
http://ec.europa.eu/eurostat/cache/GISCO/geodatafiles/NUTS_2010_60M_SH.zip
",
              temp)
unzip(temp)

# Read data
EU_NUTS <- readOGR(dsn = "./NUTS_2010_60M_SH/data", layer =
"NUTS_RG_60M_2010")

# Subset NUTS 2 level data
map_nuts2 <- subset(EU_NUTS, STAT_LEVL_ == 2)

# Draw basic plot
plot(map_nuts2)

This does produce a plot but its rather 'ugle'. Is there any way I can
subset the data further and draw a map for France, Italy, Spain, and
Portugal only? Thank you very much!

Sincerely,

Milu

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Map of Europe at NUTS 2 Level

Roger Bivand
Miluji Sb <milujisb <at> gmail.com> writes:

>
> Dear all.
>
> I would like to draw a map of France, Italy, Spain, and Portugal at NUTS 2
> level. I used the following code:
>
...
> # Subset NUTS 2 level data
> map_nuts2 <- subset(EU_NUTS, STAT_LEVL_ == 2)
>
> # Draw basic plot
> plot(map_nuts2)

country <- substring(as.character(map_nuts2$NUTS_ID), 1, 2)
map <- c("ES", "FR", "IT", "PT")
map_nuts2a <- map_nuts2[country %in% map,]
plot(map_nuts2)

but this includes all the overseas territories and islands. Use xlim=, ylim=
to exclude these, or select based on knowing their NUTS2 codes:

plot(nuts2a, axes=TRUE, xlim=c(-11.62699, 19.20174), ylim=c(34.35470, 52.04182))

Roger

PS. One gets more, and more rapid replies to this kind of question on R-sig-geo.

>
> This does produce a plot but its rather 'ugle'. Is there any way I can
> subset the data further and draw a map for France, Italy, Spain, and
> Portugal only? Thank you very much!
>
> Sincerely,
>
> Milu
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Roger Bivand
Department of Economics
NHH Norwegian School of Economics
Helleveien 30
N-5045 Bergen, Norway