Hi,

I tried your example and got everything OK. But, it is true that
differences are small.

library(plotGoogleMaps)
loc <- data.frame( name=c('berry','apple'), a=c(66873, 17863), b=c(6368,
14349),
                 c=c(48790, 15525), e=c(221739, 478877), Total=c(343770,
526614),
                 Lat=c(31.0661, 34.66447), Lon=c(-93.206, -98.4069) )
coordinates(loc) <- ~Lon+Lat
proj4string(loc) <- CRS("+proj=longlat +datum=WGS84")

m2 <- segmentGoogleMaps(loc,zcol=c('a','b','c','e'),mapTypeId='ROADMAP'
                        ,filename='excess.htm',max.radius = 300000,
                        colPalette =
c('green4','yellow','lightcoral','brown1'),
                        strokeColor = 'black', do.sqrt =T)

You can see that apple is bigger than berry.

You can check it.
piesloc <- pieSP(loc,zcol=c('a','b','c','e'), scalelist=TRUE, max.radius=
300000 ,do.sqrt =T)

plot(piesloc, col=rep(c('green4','yellow','lightcoral','brown1'),2))

apple= piesloc[piesloc$name=='apple',]
sum( sapply(1:4, function(i) apple[i,]@polygons[[1]]@area ) )
berry= piesloc[piesloc$name=='berry',]
sum( sapply(1:4, function(i) berry[i,]@polygons[[1]]@area ) )

The problem is maybe projection issue.

Best,
Milan

> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United
Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C

[5] LC_TIME=English_United Kingdom.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] plotGoogleMaps_2.0 lattice_0.20-24    maptools_0.8-29    rgdal_0.8-16
    sp_1.0-14

loaded via a namespace (and not attached):
[1] foreign_0.8-59 grid_3.0.2     tools_3.0.2


On Thu, Mar 20, 2014 at 11:56 PM, Mckay, Shawn <smckay@rand.org> wrote:

> I have been experimenting with the issue discussed below.  With anther
> data set, I have found that when there are more than 3 pie slices the
> overall pie size gets distorted.
>
>
> I am using segmentGoogleMaps to plot pie charts at various locations in
> the US.  I have notice that the sizes between the pie charts do not
> preserve their true ratio.  In the example below,  'berry' is smaller than
> 'apple'.  When plotting, it appears 'berry' is slightly bigger than
> 'apple'.  In addition, is there a way to preserve size ratios between
> layers.
>
>
> name
>
> a
>
> b
>
> c
>
> e
>
> Total
>
> Lat
>
> Lon
>
> berry
>
> 66873
>
> 6368
>
> 48790
>
> 221739
>
> 343770
>
> 31.0661
>
> -93.206
>
> apple
>
> 17863
>
> 14349
>
> 15525
>
> 478877
>
> 526614
>
> 34.66447
>
> -98.4069
>
>
>
> fileName = paste("exampleSegment",".csv",sep = "")
>   rawData = read.csv(fileName,header = T)
>
>   loc<- data.frame(Lat=rawData$Lat,Lon = rawData$Lon,rawData)
> coordinates(loc) <- ~Lon+Lat
> proj4string(loc) <- CRS("+proj=longlat")
>
> m2 <- segmentGoogleMaps(loc,zcol=c('a','b','c','e'),mapTypeId='ROADMAP'
>   ,filename='excess.htm',max.radius = 300000, colPalette =
> c('green4','yellow','lightcoral','brown1'),strokeColor = 'black') #,add =
> T,do.sqrt = F)
>
>
>
>
> ***********************
> Shawn C. McKay Ph.D.
> The RAND Corporation
> 1776 Main Street
> Santa Monica, CA 90407
> smckay@rand.org<mailto:smckay@rand.org>
> 310-393-0411 ex 6823
> ***********************
>
>
> __________________________________________________________________________
>
> This email message is for the sole use of the intended r...{{dropped:9}}
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Dr. Milan Kilibarda
Assistant professor
University of Belgrade,
Faculty of Civil Engineering,
Department of Geodesy and Geoinformatics,
Address: Bulevar kralja Aleksandra 73  11000 Belgrade, Serbia,
Mail:  kili@grf.bg.ac.rs
Web: http://dailymeteo.org/
Pub: http://scholar.google.com/citations?user=Zl2MZ3AAAAAJ&hl=en
tel:+381 11 3218516

	[[alternative HTML version deleted]]

