[enter image description here][1]
[1]: https://i.stack.imgur.com/IgLOC.png – this is what i want to draw
[2]: https://i.stack.imgur.com/S2YfL.png – this is data of this plot
>Solution :
Not a complete solution, but the essence.
library(tidyverse)
library(ggplot2)
df <- tibble(
type = c("barley",
"maize",
"sunlower oil",
"wheat"),
ukraine = c(0.974, 0.1643, 0.4221, 0.0891),
russia = c(0.095, 0.0160, 0.2140, 0.1420)
)
# A tibble: 4 x 3
type ukraine russia
<chr> <dbl> <dbl>
1 barley 0.974 0.095
2 maize 0.164 0.016
3 sunlower oil 0.422 0.214
4 wheat 0.0891 0.142
df %>%
gather(-type, key = "country", value = "value") %>%
ggplot() +
aes(x = type, y = value, fill = country) +
geom_col() +
coord_flip()
