I see function * segmentGoogleMaps* from package *plotGoogleMaps* does
exactly what I need with data from dataset *meuse*.
When I ran code:
coordinates(sampledf)<-~x+y # convert to SPDF
proj4string(sampledf) <- CRS('+init=epsg:28992')# adding Coordinate
Referent Sys.
# Create web map of Point data
m<-plotGoogleMaps(sampledf,filename='myMap1.htm')
Everything works just fine. When I try to run code:
# colPalette defines colors for plot
m<-segmentGoogleMaps(sampledf, zcol=c('City','Village'),
mapTypeId='ROADMAP',
filename='myMap4.htm',colPalette=c('#E41A1C','#377EB8'),
strokeColor='black')
everything goes wrong and all points seems to show in one single coordinate
pair.
The problem is I think that data in meuse dataset are different from mine
(I think UTM).
When tried to convert same result.
I desperately need to see pie chart in a google map so please help solving
this issue
On Wed, Apr 16, 2014 at 12:17 PM, Jim Lemon <[email protected]> wrote:
> See inline
>
>
> On 04/16/2014 08:13 PM, DrunkenPhD wrote:
>
>> No nothing :((((
>> I tried :
>> > hdf <- get_map(location = c(20.166065, 41.270679), zoom = 8, maptype
>> = 'roadmap')
>> > sampledf<-read.table(text="x y City Village
>>
>> 19.9437314 40.7086377 120 425
>> 20.2214171 41.4924336 1 1
>> 20.0955891 39.9481364 4 4
>> 20.9506636 40.6447347 10 15",header=TRUE)
>> # make the graphics device high enough to hold Albania
>> x11(height=10,width=5)
>> # display the map upon which you want the pies
>>
>
> hdf <- get_map(location = c(20.166065, 41.270679), zoom = 8,
> maptype = 'roadmap')
> ggmap(hdf, extent = 'device')
> # I don't know if you have to do anything else here
>
>
> # display the pies
>> library(plotrix)
>> for(pp in 1:4) floating.pie(sampledf[pp,"x"],sampledf[pp,"y"],
>> unlist(sampledf[pp,c("City","Village")]),radius=0.1)
>>
>> but pffff nothing
>> What to do
>>
>
> Look at the documentation for ggmap (I don't have the package on my
> system, so I can't do it for you). Try par("usr") to see the coordinates of
> the plot.
>
> Jim
>
--
Endri Raço PhD
_________________________________________________
Polytechnic University of Tirana
Faculty of Mathematical Engineering and Physics Engineering
Department of Mathematical Engineering
Address: Sheshi Nene Tereza, Nr. 4, Tirana - ALBANIA
Mobile: ++ 355 682061988
[[alternative HTML version deleted]]
______________________________________________
[email protected] mailing list
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.