【发布时间】:2016-05-25 11:02:31
【问题描述】:
我有一个看起来像这样的数据框:
Taxation=c("Partially", "Fully", "Partially","Exempt","Partially","Exempt", "Partially", "Partially", "Fully", "Fully", "Fully", "Exempt", "Exempt", "Fully", "Exempt", "Exempt","Exempt")
Orientation=c("Non-Profit", "Non-Profit/Sustainable", "Non-Profit", "Non-Profit", "For-Profit", "Non-Profit/Sustainable", "Non-Profit", "Non-Profit/Sustainable", "Non-Profit", "Non-Profit", "Non-Profit/Sustainable", "Non-Profit", "Non-Profit", "Non-Profit/Sustainable", "Non-Profit/Sustainable", "Non-Profit", "Non-Profit/Sustainable")
Country=c("Austria","France", "Spain", "Ireland", "Greece", "Finland", "Belgium", "Austria", "Belgium", "Slovenia", "Italy", "France", "Belgium", "Portugal", "Netherlands" ,"Denmark", "Germany")
Institute=c("Inst1", "Inst2", "Inst3", "Inst4", "Inst5", "Inst6", "Inst7", "Inst8", "Inst9", "Inst10", "Inst11", "Inst12", "Inst13", "Inst14", "Inst15", "Inst16", "Inst17")
Count=rep(1,times=17)
df<-data.frame(Taxation=Taxation, Orientation=Orientation, Country=Country, Institute=Institute,Count=Count)
根据这个数据框,我进行以下计算:
with(df, table(Taxation, Orientation))
Taxation For-Profit Non-Profit Non-Profit/Sustainable
Exempt 0 4 3
Fully 0 2 3
Partially 1 3 1
我的范围是制作分类变量 Taxation 和 Orientation 的双向散点图,其中将显示带有项目符号的每种可能性的数量,每个项目符号将标有原产国作为标签每个机构。它有帮助,我想重现这样的图表:
请注意,这张图表很好地显示了由不同组合产生的案例数量,并带有一个大“框”。
【问题讨论】:
标签: r plot ggplot2 scatter-plot