私がやろうとしているのは、いくつかの国間の比較値を表示する折れ線グラフをプロットすることです。私が得るチャートは次のとおりです。
ここでの問題は、形状と色の両方が凡例にリストされていることです。凡例をその国のグループ (形状を使用) と色の組み合わせにしたい. 私はこのビットを使用しています:
ggplot(data=Data,aes(x=Indicator,y=Numeric,group=Country,shape=group,colour=Country))+geom_point()+geom_line()
データはこんな感じ
Indicator Year Country Numeric data group
1 All causes 2008 Afghanistan 1663 3.22 Very Low
2 All causes 2008 Albania 518 8.53 Low
3 All causes 2008 Algeria 591 8.64 Low
4 All causes 2008 Andorra 310 21.25 High
5 All causes 2008 Angola 1685 10.08 Low
6 All causes 2008 Antigua and Barbuda 682 9.07 Low
7 All causes 2008 Argentina 553 14.38 Medium
8 All causes 2008 Armenia 864 6.62 Very Low
9 All causes 2008 Australia 278 16.76 Medium
10 All causes 2008 Austria 335 16.17 Medium
11 All causes 2008 Azerbaijan 918 4.54 Very Low
12 All causes 2008 Bahamas 629 16.80 Medium
13 All causes 2008 Bahrain 408 11.41 Low
14 All causes 2008 Belgium 369 15.10 Medium
15 All causes 2008 Brazil 667 5.86 Very Low
16 All causes 2008 Costa Rica 400 30.61 Very High
17 All causes 2008 Ivory Coast 2567 6.82 Very Low
18 All causes 2008 Marshall Islands 2681 19.46 High
19 All causes 2008 Netherlands 323 19.69 High
20 All causes 2008 New Zealand 312 19.56 High
誰かがこれを達成するために何ができるか教えてもらえますか? これにかなりの時間を費やしたにもかかわらず、これを本当に分解することはできません。