The countries that had the most people who had malaria in 2012 are

Each of these countries had more than 2,000,000 cases. All of these countries are in Africa.

Document Description

This document consists of written material interspersed with code written in a programming language called R. The data was downloaded from http://manage.hdx.rwlabs.org/hdx/api/exporter/indicator/csv/TT008/source/who-gho/fromYear/1950/toYear/2014/language/en/TT008_Baseline.csv and saved to the Desktop. The following steps were required to produce the chart below.

Set the working directory, and read in the spreadsheet with malaria data.

setwd('~/Desktop')
df <- read.csv('TT008_Baseline.csv', stringsAsFactors=FALSE)

Get the libraries needed to filter data and draw charts.

library(dplyr)
library(ggplot2)
df %>% 
  filter(X2012 > 2000000) %>% 
  ggplot(aes(x=Country.name, y=X2012/1000000)) + 
  geom_bar() +
  xlab("Country Names") + 
  ylab("Number of People (in millions)") +
  ggtitle("Countries with more than 2,000,000 cases of Malaria in 2012")

plot of chunk unnamed-chunk-2