[R] Elaborate OrgChart
Jim Lemon
drjimlemon at gmail.com
Mon Mar 20 22:19:53 CET 2017
Hi Guillaume,
If you are talking about the "Bubble Chart", you might be able to use
the boxed.labels function in plotrix. Here is a slight modification of
the first example for the size_n_color function that may help.
library(plotrix)
meantemp<-c(19,22,25,29,21,20,16,27,23,26)
totalrain<-c(174,152,196,120,177,183,92,153,161,85)
numpumpkin<-c(53,47,61,63,38,42,48,71,66,29)
meanwt<-c(1.5,2.3,2.8,1.9,2.4,1.8,2.6,2.2,1.7)
size_n_color(meantemp,totalrain,meanwt/5,NA,xlim=c(15,30),
color.scale(numpumpkin,c(0.8,0),c(0.8,1),0),
xlab="Temperature (degrees C)",ylab="Rainfall (mm)",
main="Number and weight of pumpkins by temperature and rainfall",
xat=seq(15,30,by=5),yat=seq(80,200,by=20))
color.legend(15,55,18.5,60,seq(40,70,by=10),
rect.col=color.scale(seq(40,70,by=10),c(0.8,0),c(0.8,1),0))
points(15:18,rep(126,4),cex=seq(1.5,3.0,by=0.5))
text(15:19,rep(134,5),c("1.5","2.0","2.5","3.0","kg"))
par(xpd=TRUE)
text(13.5,60,"Number of\npumpkins")
par(xpd=FALSE)
boxed.labels(meantemp,totalrain,numpumpkin,cex=0.7)
Jim
On Tue, Mar 21, 2017 at 4:39 AM, Guillaume LACOUR <glacour at adding.fr> wrote:
> Hi,
> I'm trying to draw a chart such as the one provided by gvisOrgChart in the GoogleVis demo, that would provide more options such as boxes with varying size or the ability to add basic statistics on each subgroup represented by a box.
> Any idea ?
> Thanks
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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