Hello, I am trying to build a map of a country which shows informations to its regions in a popup window as soon as someone clicks on a region. Thank you -- View this message in context: http://r.789695.n4.nabble.com/interactive-Map-Popups-tp4710226.html Sent from the R help mailing list archive at Nabble.com.
I would start by looking at the "Graphics" and "Web Technologies" entries in "Task Views" on CRAN. In addition, I suspect there might be some packages listed in the Spatial task view that could do this. -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 7/22/15, 4:35 PM, "R-help on behalf of Marie-Louise" <r-help-bounces at r-project.org on behalf of timcke at hotmail.de> wrote:>Hello, >I am trying to build a map of a country which shows informations to its >regions in a popup window as soon as someone clicks on a region. >Thank you > > > >-- >View this message in context: >http://r.789695.n4.nabble.com/interactive-Map-Popups-tp4710226.html >Sent from the R help mailing list archive at Nabble.com. > >______________________________________________ >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.
I am quite happy with that package leaflet which is not yet on CRAN but available on Githib. https://github.com/rstudio/leaflet <https://github.com/rstudio/leaflet> -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 670 bytes Desc: Message signed with OpenPGP using GPGMail URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150723/4aac61fb/attachment.bin>
You might be interested in the HWidentify and HTKidentify functions in the TeachingDemos package. They currently don't do maps, but since the functions are pure R code it would not be hard to modify them. On Wed, Jul 22, 2015 at 5:35 PM, Marie-Louise <timcke at hotmail.de> wrote:> Hello, > I am trying to build a map of a country which shows informations to its > regions in a popup window as soon as someone clicks on a region. > Thank you > > > > -- > View this message in context: http://r.789695.n4.nabble.com/interactive-Map-Popups-tp4710226.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > 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.-- Gregory (Greg) L. Snow Ph.D. 538280 at gmail.com
Thank you both very much for your tips, and excuse my horrible english
skills.
R is new to me so I tried to work with code that was already there.
I managed to get close to what I wanted with
require(googleVis)
G4 = gvisGeoChart(con2,
locationvar = "DE",
colorvar = "data_7", hovervar = "data_6",
options=list(
width=800, height=600, region="DE",
displayMode="regions",
resolution="provinces"))
plot(G4)
but it seems like googleVis does not support resolution="provinces"
for
Germany :(
Do you know anything that simple as this code to get to what I wanted?
Thank you very much
--
View this message in context:
http://r.789695.n4.nabble.com/interactive-Map-Popups-tp4710226p4710257.html
Sent from the R help mailing list archive at Nabble.com.
Some shapefiles for Germany can be found here http://www.statsilk.com/maps/download-free-shapefile-maps <http://www.statsilk.com/maps/download-free-shapefile-maps>> On Jul 23, 2015, at 21:36, Erin Hodgess <erinm.hodgess at gmail.com> wrote: > > Hello Erich: > > I just looked at your leaflet package and its examples. It is awesome! > > Thanks, > Erin > > > On Thu, Jul 23, 2015 at 6:28 AM, Erich Neuwirth <erich.neuwirth at univie.ac.at <mailto:erich.neuwirth at univie.ac.at>> wrote: > I am quite happy with that package leaflet which is not yet on CRAN > but available on Githib. > > https://github.com/rstudio/leaflet <https://github.com/rstudio/leaflet> <https://github.com/rstudio/leaflet <https://github.com/rstudio/leaflet>> > > > ______________________________________________ > R-help at r-project.org <mailto:R-help at r-project.org> mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help <https://stat.ethz.ch/mailman/listinfo/r-help> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html <http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > > > > -- > Erin Hodgess > Associate Professor > Department of Mathematical and Statistics > University of Houston - Downtown > mailto: erinm.hodgess at gmail.com <mailto:erinm.hodgess at gmail.com>-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 670 bytes Desc: Message signed with OpenPGP using GPGMail URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20150723/70b01028/attachment.bin>
Marie-Louise,
As long sa I know you have to gie googleVis the ISO code for provinces.
GR <- data.frame( ISO = c("DE-BW",
"DE-BY",
"DE-BE",
"DE-BB",
"DE-HB",
"DE-HH",
"DE-HE",
"DE-MV",
"DE-NI",
"DE-NW",
"DE-RP",
"DE-SL",
"DE-SN",
"DE-ST",
"DE-SH",
"DE-TH"),
name = c("Baden-W?rttemberg",
"Bayern",
"Berlin",
"Brandenburg",
"Bremen",
"Hamburg",
"Hessen",
"Mecklenburg-Vorpommern",
"Niedersachsen",
"Nordrhein-Westfalen",
"Rheinland-Pfalz",
"Saarland",
"Sachsen",
"Sachsen-Anhalt",
"Schleswig-Holstein",
"Th?ringen"), value = 1:16)
G3 <- gvisGeoMap(GR, locationvar='ISO',
numvar='value', options=list(region="DE",
displayMode="regions", resolution="provinces,"))
plot(G3)
Daniel Merino
2015-07-23 17:00 GMT-03:00 Erich Neuwirth <erich.neuwirth at
univie.ac.at>:
> Some shapefiles for Germany can be found here
>
> http://www.statsilk.com/maps/download-free-shapefile-maps <
> http://www.statsilk.com/maps/download-free-shapefile-maps>
>
> > On Jul 23, 2015, at 21:36, Erin Hodgess <erinm.hodgess at
gmail.com> wrote:
> >
> > Hello Erich:
> >
> > I just looked at your leaflet package and its examples. It is
awesome!
> >
> > Thanks,
> > Erin
> >
> >
> > On Thu, Jul 23, 2015 at 6:28 AM, Erich Neuwirth <
> erich.neuwirth at univie.ac.at <mailto:erich.neuwirth at
univie.ac.at>> wrote:
> > I am quite happy with that package leaflet which is not yet on CRAN
> > but available on Githib.
> >
> > https://github.com/rstudio/leaflet
<https://github.com/rstudio/leaflet>
> <https://github.com/rstudio/leaflet
<https://github.com/rstudio/leaflet>>
> >
> >
> > ______________________________________________
> > R-help at r-project.org <mailto:R-help at r-project.org> mailing
list -- To
> UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help <
> https://stat.ethz.ch/mailman/listinfo/r-help>
> > PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html <
> http://www.r-project.org/posting-guide.html>
> > and provide commented, minimal, self-contained, reproducible code.
> >
> >
> >
> > --
> > Erin Hodgess
> > Associate Professor
> > Department of Mathematical and Statistics
> > University of Houston - Downtown
> > mailto: erinm.hodgess at gmail.com <mailto:erinm.hodgess at
gmail.com>
>
> ______________________________________________
> 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.
>
--
Daniel
[[alternative HTML version deleted]]