[R] FW: Bubble plots

Cody Hamilton Cody_Hamilton at Edwards.com
Sat Aug 2 14:31:00 CEST 2008


Is there a way to create a 'bubble plot' in R?

For example, if we define the following data frame containing the level of y observed for 5 patients at three time points:

time<-c(rep('time 1',5),rep('time 2',5),rep('time 3',5))
y<-c('a','b','c','d','a','b','c','a','d','a','a','a','b','c','d')
D<-data.frame(cbind(y,time))

I would like to display the percentage of subjects in each level of y at each time point as a bubble whose size is proportional to the percentage of subjects in the given level of y at the given time point.  Thus, in the case of the data frame above the plot would have the levels of y ('a','b','c','d') on the y-axis and the levels of time ('time 1','time 2', time 3') on the x-axis with four bubbles above each time point (e.g. the size of the bubble in the bottom left corner of the plot would be proportional to the percentage of patients with y='a' at time='time 1').

I am running R 2.7.1 under windows.

Regards,
   -Cody

This message contains information which may be confident...{{dropped:8}}



More information about the R-help mailing list