I have the below data visualisation for life expectancy of Asia using gapminder data-set, How can I change the plot to order it based on countries with higher life expectancy downwards?
Here is my code :
install.packages("gapminder")
library(gapminder)
Asia_sample2 <- gapminder %>% filter (gapminder$continent =="Asia")
p1 <- ggplot(data = Asia_sample2, aes(x = year , y = country , fill = lifeExp ))
p1 + geom_raster() +scale_fill_gradient(low="blue", high="red") +
theme_bw() +
labs(title = "Estimated Life Expectancy in Asia , Years(1952-2007)")