# [R] Spie charts

Jim Lemon drj|m|emon @end|ng |rom gm@||@com
Tue Mar 30 10:58:22 CEST 2021

```Hi Ferri,
Just for fun, I plotted six countries with the current COVID deaths,
per million against both population and median income. Even I was
surprised.

library(plotrix)
country<-c("USA","Brazil","India","UK","Czechia","Mexico")
COVIDdeath<-c(1694,1471,117,1858,2445,1553)
Countrypop<-c(332,214,1390,68,11,130)
median_income<-c(65850,9130,2120,42220,21940,9480)
png("COVID_death_by_pop.png")
sector.colors=color.scale(median_income,extremes=c("red","green")),
color.legend(xl=-2600,yb=-2600,xr=500,yt=-2500,
legend=seq(2000,66000,length.out=5),
rect.col=color.scale(seq(2000,66000,length.out=5),extremes=c("red","green")))
text(0,2850,"COVID deaths per million population",xpd=TRUE)
text(-1095,-2700,"Median income USD",xpd=TRUE)
text(2000,-2600,"Sector angle = population",xpd=TRUE)
dev.off()

Jim

On Mon, Mar 29, 2021 at 2:59 AM Ferri Leberl <ferri.leberl using gmx.at> wrote:
>
> Dear ∀,
> Ist there a function to plot "spie charts" in R?
> https://en.wikipedia.org/wiki/spie_chart
> (These are a combination of pie charts and radial pie charts, where the angle represents one dimension and the radius of the respective sector another dimension)
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help