我想在R中打印一个气泡图.我遇到的问题是,我的x和我的y轴都是离散的.从理论上讲,这意味着许多数据点(气泡)最终都在同一个坐标上.我宁愿将它们分散在数据点周围,但仍然在一个象限内,这使得气泡属于相应的x/y坐标.
我认为最好通过一个小例子来证明.以下代码应突出显示问题:
# Example
require(ggplot2)
zz <- textConnection("Row PowerSource ProductSegment Price Model ManufacturingLocation Quantity
1 High SegmentA Low ModA LocationA 5000
2 Low SegmentB Low ModB LocationB 25000
3 High SegmentC Low ModC LocationC 15000
4 Low SegmentD High ModD LocationD 30000
5 High SegmentE High ModE LocationA 2500
6 Low SegmentA Low ModF LocationB 110000
7 High SegmentB Low ModG LocationC 20000
8 Low SegmentC Low ModH LocationD 3500
9 High SegmentD Low ModI LocationA 65500
10 Low SegmentE …
Run Code Online (Sandbox Code Playgroud)