Skip to content
Prev 350393 / 398506 Next

Interactive maps

On Sun, 26 Apr 2015 at 00:56 Antonio Serrano via R-help <
r-help at r-project.org> wrote:

            
to read in images that are georeferenced. Depending on the provenance of
your files, it might be as simple as doing
library(raster)
r <- raster(filename)
plort(r)
xy <- locator(, type = "p")  ## click on the map

If the values of these are not right you'll need further digging, and
perhaps if your image is not in longitude/latitude you'll need to transform
the locator points.

Also check out ?getGraphics event in grDevices, which can be used (with
care) to build quite complex interactive applications.

Another promising option is to use a Shiny application, where each plot
gives a simple way to get click events from the user - but then you really
are building an application out in the frontier edges of R land.

Cheers, Mike.

Thanks again