[R] Pie charts using plotGooglemaps
DrunkenPhD
endri81 at gmail.com
Wed Apr 16 11:59:45 CEST 2014
Ok this seems to work perfect,
Dont want to be boring but what if plotting in real map smth like:
hdf <- get_map(location = c(20.166065, 41.270679), zoom = 8, maptype =
'roadmap')
ggmap(hdf, extent = 'device')
Regards
On Wednesday, April 16, 2014 11:51:43 AM UTC+2, Jim Lemon wrote:
>
> On 04/16/2014 04:43 AM, DrunkenPhD wrote:
> > Sorry Jim not for my beginner level :(((
> >
> > So if my data are like this :
> >
> > xyCityVillage
> >
> > 19.943731440.7086377120425
> >
> > 20.221417141.492433611
> >
> > 20.095589139.948136444
> >
> > 20.950663640.64473471015
> >
> > how do I plot for every point(x,y) a pie chart with
> slices(City,Village)?
> >
> > Regards
> >
> >
> > how do I plot for every point(x,y) a pie chart with
> slices(City,Village)?
> >
> >
> Okay, let's try again.
>
> # get yer data
> 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
> map(xlim=c(19,21.1),ylim=c(39.5,42.6))
> # 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)
>
> Jim
>
> ______________________________________________
> R-h... at r-project.org <javascript:> 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.
>
More information about the R-help
mailing list