[R-sig-Geo] plotGoogleMaps - Represent Text on map

Abhishek Kapoor kapoor.ab at gmail.com
Thu Jan 23 06:22:53 CET 2014


Thanks a lot.

Its working now :)

Regards
Abhishek


On Wed, Jan 22, 2014 at 5:52 PM, Milan Kilibarda [via R-sig-geo] <
ml-node+s2731867n7585604h15 at n2.nabble.com> wrote:

> Dear Abhishek,
>
> Here is reproducible example, doing what you want to get. I guess.
>
> Best,
>
> Milan
>
>
> library(plotGoogleMaps)
>
> # Point data
>
> data(meuse)
> coordinates(meuse)<-~x+y
> proj4string(meuse) <- CRS('+init=epsg:28992')
>
> ma<-plotGoogleMaps(meuse,zcol="ffreq",
> colPalette=c("#FFF7BC","#FEC44F","#D95F0E"),
>                    filename='myMap82.html',mapTypeId= 'TERRAIN',
>                    fitBounds=T)
>
>
> #################
> # Show text in markers
>
> meuse$ffreq2 <- factor(meuse$ffreq, labels = c("One", "Two", "Three"))
>
> ma<-plotGoogleMaps(meuse,zcol="ffreq2",
> colPalette=c("#FFF7BC","#FEC44F","#D95F0E"),
>                    filename='myMap82.html',mapTypeId= 'TERRAIN',
>                    fitBounds=T)
>
> #################
> # Show just labels (text) without markers
>
> ma<-plotGoogleMaps(meuse,zcol="ffreq2",
>                    iconMarker= iconlabels(meuse$ffreq2,
> colPalette=c("#FFF7BC","#FEC44F","#D95F0E")),
>                    colPalette=c("#FFF7BC","#FEC44F","#D95F0E"),
>                    filename='myMap82.html',mapTypeId= 'TERRAIN',
>                    fitBounds=T)
>
>
>
>
> On Wed, Jan 22, 2014 at 7:57 AM, Abhishek Kapoor <[hidden email]<http://user/SendEmail.jtp?type=node&node=7585604&i=0>>wrote:
>
>
> > Hi Sir,
> >
> > is it possible to plot map using factor variable?
> >
> > I am trying to plot ATMs, Hospital, and restaurant location (Lat/Long)
> and
> > with address but i m not getting desired result.
> >
> > Below is the code
> >
> >
> > eq <- read.csv ('C:/Users/abc/Desktop/2013_08_01_NCR_Master.csv')
> > str (eq)
> >
> > 'data.frame':   13430 obs. of  6 variables:
> >  $ Type       : Factor w/ 3 levels "ATM","Hospital",..: 2 2 2 2 2 2 2 2
> 2 2
> > ...
> >  $ Lat        : num  28.5 28.5 28.4 28.6 28.7 ...
> >  $ Lng        : num  77 77 77 77 77 ...
> >  $ PhoneNumber: Factor w/ 5562 levels "","0","011 2004 4406",..: 4922 1
> > 2610
> > 1 1 2669 1 2652 1 4075 ...
> >  $ Address    : Factor w/ 13394 levels "???, IGI Airport T3 Road, IGI
> > Airport, New Delhi, DL",..: 11064 11071 13208 9306 12497 2644 10809 9722
> > 6499 12089 ...
> >  $ Type1      : int  2 2 2 2 2 2 2 2 2 2 ...
> >
> > coordinates(eq) = ~Lng + Lat
> > proj4string(eq) = CRS("+proj=longlat +datum=WGS84")
> > eq <- SpatialPointsDataFrame( eq , data = data.frame( id = row.names( eq
> )
> > )
> > )
> >
> > ma<-plotGoogleMaps(eq,zcol="Type", colPalette=c("#FFF7BC",
> > "#FEC44F","#D95F0E"),filename='myMap82.html',mapTypeId= 'TERRAIN',
> > fitBounds=T)
> >
> > but it is not producing desired results
> > I want only 3 color bubbles by "Type" - ATM, Hospital & Restaurants
> >
> > I hope you can help me, this is my first time in R.
> >
> > I am using Windows and R is 3.0.2
> > Thanks in advance
> >
> > Regards
> > Abhishek
> >
> >
> >
> > --
> > View this message in context:
> >
> http://r-sig-geo.2731867.n2.nabble.com/plotGoogleMaps-Represent-Text-on-map-tp7585603.html
> > Sent from the R-sig-geo mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > R-sig-Geo mailing list
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=7585604&i=1>
> > https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> >
>
>
>
> --
> Milan Kilibarda
>
> University of Belgrade,
> Faculty of Civil Engineering,
> Department of Geodesy and Geoinformatics,
> Address: Bulevar kralja Aleksandra 73  11000 Belgrade, Serbia,
> Mail:  [hidden email]<http://user/SendEmail.jtp?type=node&node=7585604&i=2>
>
> tel:+381 11 3218516
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email] <http://user/SendEmail.jtp?type=node&node=7585604&i=3>
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://r-sig-geo.2731867.n2.nabble.com/plotGoogleMaps-Represent-Text-on-map-tp7585603p7585604.html
>  To unsubscribe from plotGoogleMaps - Represent Text on map, click here<http://r-sig-geo.2731867.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=7585603&code=a2Fwb29yLmFiQGdtYWlsLmNvbXw3NTg1NjAzfDE5NTg4MDkyNjg=>
> .
> NAML<http://r-sig-geo.2731867.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/plotGoogleMaps-Represent-Text-on-map-tp7585603p7585610.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list