## example 1
plot(c(0,1), c(0,1))
par(new=TRUE)
pies(
list(
a=nv(c(1,2,3),c('one','two','thre')),
b=nv(c(2,2,3),c('one','two','thre')),
c=nv(c(1,2,3),c('one','two','thre'))
),
x0=c(0,.5,1),
y0=c(0,.5,1), radii=6, border=c('gray', 'black', 'red'),
xlim=usr2lims()$x,
ylim=usr2lims()$y,
)
## example 2
n <- 200
n.groups <- 10
n.subgroups <- 6
grps <- paste('gene',seq(1,n.groups), sep='')[round(runif(n,1,n.groups))]
subgrps <- paste('species',seq(1,n.subgroups), sep='')[round(runif(n,1,n.subgroups))]
group.df <- cbind.data.frame(grps,subgrps)
subgroup.list <- by(group.df, group.df$grps, function(x) x$subgrps)
pie.list <- lapply(subgroup.list, table)
col.tab <- nv(rainbow(6), unique(subgrps))
pies(x=pie.list, x0=rnorm(n.groups), y0=rnorm(n.groups), radii=10, show.labels=TRUE, show.slice.labels=TRUE, color.table=col.tab)
Run the code above in your browser using DataLab