Нужно. сделать диаграмму ap ie с метками% и легендой для этого фрейма данных - PullRequest
0 голосов
/ 26 мая 2020
 > mec_plot

  commodity                                                                      MEC  

1 Toys, games and sports requisites; parts and accessories thereof               3.6  
2 Articles of apparel and clothing accessories, knitted or crocheted             4.9  
3 Articles of apparel and clothing accessories, not knitted or crocheted         6.3  
4 Machinery and mechanical appliances; parts thereof                             15.6 
5 Electrical machinery and equipment and parts thereof; sound recorders and r .… 20   
6 Other                                                                          49.6

Мне нужно преобразовать этот фрейм данных в график ap ie с помощью ggplot. Мне также нужна легенда для товарной переменной

, это моя попытка:

   MEC_plot <- ggplot(mec_plot, aes(x = "MEC", y = MEC, fill = commodity)) +
    geom_bar(stat = "identity",color = "black") +
  coord_polar("y") +
  geom_text(aes(y = MEC, label = MEC), position = position_stack(vjust = 0.5)) +
  labs(title = "Top Export Categories for China") +
  theme_void() 
MEC_plot
...