# NOT RUN {
require(moonBook)
require(ggplot2)
browser=c("MSIE","Firefox","Chrome","Safari","Opera")
share=c(50,21.9,10.8,6.5,1.8)
df=data.frame(browser,share)
PieDonut(df,aes(browser,count=share),r0=0.7,start=3*pi/2,labelpositionThreshold=0.1)
# }
# NOT RUN {
PieDonut(df,aes(browser,count=share),r0=0.7,explode=5,start=3*pi/2)
PieDonut(mtcars,aes(gear,carb),start=3*pi/2,explode=3,explodeDonut=TRUE,maxx=1.7)
PieDonut(mtcars,aes(carb,gear),r0=0)
PieDonut(acs,aes(smoking,Dx),title="Distribution of smoking status by diagnosis")
PieDonut(acs,aes(Dx,smoking),ratioByGroup=FALSE,r0=0)
PieDonut(acs,aes(Dx,smoking),selected=c(1,3,5,7),explodeDonut=TRUE)
PieDonut(acs,aes(Dx,smoking),explode=1,selected=c(2,4,6,8),labelposition=0,explodeDonut=TRUE)
PieDonut(acs,aes(Dx,smoking),explode=1)
PieDonut(acs,aes(Dx,smoking),explode=1,explodeDonut=TRUE,labelposition=0)
PieDonut(acs,aes(Dx,smoking),explode=1,explodePie=FALSE,explodeDonut=TRUE,labelposition=0)
PieDonut(acs,aes(Dx,smoking),selected=c(2,5,8), explodeDonut=TRUE,start=pi/2,labelposition=0)
PieDonut(acs,aes(Dx,smoking),r0=0.2,r1=0.9,r2=1.3,explode=1,start=pi/2,explodeDonut=TRUE)
PieDonut(acs,aes(Dx,smoking),r0=0.2,r1=0.9,r2=1.3,explode=1,start=pi/2,labelposition=0)
PieDonut(acs,aes(Dx,smoking),explode=1,start=pi,explodeDonut=TRUE,labelposition=0)
require(dplyr)
df=mtcars %>% group_by(gear,carb) %>% summarize(n=n())
PieDonut(df,aes(pies=gear,donuts=carb,count=n),ratioByGroup=FALSE)
# }
Run the code above in your browser using DataLab