[R] Match Coordinates to NUTS 2 ID

Miluji Sb milujisb at gmail.com
Fri May 27 12:20:57 CEST 2016


Thank you for your reply. I am trying to use the over function - but having
trouble. Asked at R-sig-geo. Thanks again!

Sincerely,

Milu

On Fri, May 27, 2016 at 12:49 AM, MacQueen, Don <macqueen1 at llnl.gov> wrote:

> Perhaps the
>   over()
> function in the sp package.
>
> (in which case, R-sig-geo might be a better place to ask).
>
> -Don
>
> --
> Don MacQueen
>
> Lawrence Livermore National Laboratory
> 7000 East Ave., L-627
> Livermore, CA 94550
> 925-423-1062
>
>
>
>
>
> On 5/26/16, 2:30 PM, "R-help on behalf of Miluji Sb"
> <r-help-bounces at r-project.org on behalf of milujisb at gmail.com> wrote:
>
> >Dear all,
> >
> >
> >I have downloaded the NUTS 2 level data from
> >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)
> >
> >I also have data for a variable by coordinates, which looks like this:
> >
> >structure(list(LON = c(-125.25, -124.75, -124.25, -124.25, -124.25,
> >-124.25), LAT = c(49.75, 49.25, 42.75, 43.25, 48.75, 49.25),
> >    yr = c(2.91457704560515, 9.94774197180345, -2.71956412885765,
> >    -0.466213169185147, -36.6645659563374, 10.5168056769535)), .Names =
> >c("LON",
> >"LAT", "yr"), row.names = c(NA, 6L), class = "data.frame")
> >
> >I would like to match the coordinates to their corresponding NUTS 2 region
> >- is this possible? Any help will be high appreciated. Thank you!
> >
> >Sincerely,
> >
> >Milu
> >
> >       [[alternative HTML version deleted]]
> >
> >______________________________________________
> >R-help at r-project.org 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.
>
>

	[[alternative HTML version deleted]]



More information about the R-help mailing list