2

I am using a bubble chart to visually present my data. The problem I am facing is the bubbles with smaller area are hidden behind a larger bubble in a bubble chart in R.

V1  V2                          V3     V4
fl  unfair business practices   14      Y
fl  Corrections                  1      Y
fl  Product differs              1      Y
fl  refund not paid              0      Y
fl  Single premium               0      Y
fl  unfair business practices    52     N
fl  Corrections                  63     N
fl  Product differs              9      N
fl  refund not paid              2      N
fl  Single premium               2      N
mc  unfair business practices    19     Y
mc  Corrections                  0      Y
mc  Single premium               0      Y
mc  unfair business practices    36     N
mc  Corrections                  2      N
mc  Single premium               2      N

symbols(dat1$V2, dat1$V1, circles=dat1$V3)
radius <- sqrt( dat1$V3/ pi )
symbols(dat1$V2, dat1$V1, circles=radius, inches = 0.35, fg = "dark blue", bg = "red", xlab = "CASE REASON", ylab = "WORDS")

My problem is (say) V1 = "fl" and V2 = "unfair business practices" appears twice in my data, I am plotting 2 bubbles, but the smaller one is hidden behind the Larger bubble. I want the smaller one to be visible in my plot

Also I want to use V4 column to represent the color of the bubble. Ex: If V4 = "Y", I want the bubble to be red else I want it to be green.

Any help would be appreciated. Thanks

4

1 に答える 1