Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pil.pro.capite.3$X2017 <-as.numeric(pil.pro.capite.3$X2017)
- df<-pil.pro.capite.3 %>%
- mutate(dollars_per_day =X2017/365) %>%
- filter(Country %in% c("Algeria","Angola","Benin","Botswana","Burkina Faso","Burundi","Cameroon","Cabo Verde","Central African Republic","Chad","Comoros","Democratic Republic of the Congo","Republic of Congo","Côte d'Ivoire","Djibouti","Egypt","Equatorial Guinea","Eritrea","Ethiopia","Gabon","Gambia","Ghana","Guinea","Guinea-Bissau","Kenya","Lesotho","Liberia","Libya","Madagascar","Malawi","Mali","Mauritania","Mauritius","Morocco","Mozambique","Namibia","Niger","Nigeria","Rwanda","Senegal","Seychelles","Sierra Leone","South Africa","Sudan","Swaziland","Tanzania","Togo","Tunisia","Uganda","Zambia","Zimbabwe") ) %>%
- arrange(desc(dollars_per_day)) %>%
- select(Country,dollars_per_day)
- write.csv(df,file = "dollari al giorno.csv",row.names = FALSE)
- df %>%
- mutate(Country = reorder(Country,dollars_per_day) )%>%
- ggplot(aes(Country,dollars_per_day)) +
- geom_bar(stat = "identity",fill="gray",colour="red") +
- coord_flip() +
- ylab("Dollars per day") +
- xlab("African state") +
- ggtitle("Dollars per day", subtitle = "for African state in 2017 ")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement