Evaluating bird flu - 2003 to 2008

This report is created to identify the cases/death of bird flu in multiple countries from 2003-2008.

BirdFlu = read.csv("BirdFlu.csv")

Here we identify the format of the data

BirdFlu
##    Year   Type Azerbaijan Bangladesh Cambodia China Djibouti Egypt Indonesia
## 1  2003  Cases          0          0        0     1        0     0         0
## 2  2003 Deaths          0          0        0     1        0     0         0
## 3  2004  Cases          0          0        0     0        0     0         0
## 4  2004 Deaths          0          0        0     0        0     0         0
## 5  2005  Cases          0          0        4     8        0     0        20
## 6  2005 Deaths          0          0        4     5        0     0        13
## 7  2006  Cases          8          0        2    13        1    18        55
## 8  2006 Deaths          5          0        2     8        0    10        45
## 9  2007  Cases          0          0        1     5        0    25        42
## 10 2007 Deaths          0          0        1     3        0     9        37
## 11 2008  Cases          0          1        0     3        0     7        18
## 12 2008 Deaths          0          0        0     3        0     3        15
##    Iraq Lao.People.s.Democratic.Republic Myanmar Nigeria Pakistan Thailand
## 1     0                                0       0       0        0        0
## 2     0                                0       0       0        0        0
## 3     0                                0       0       0        0       17
## 4     0                                0       0       0        0       12
## 5     0                                0       0       0        0        5
## 6     0                                0       0       0        0        2
## 7     3                                0       0       0        0        3
## 8     2                                0       0       0        0        3
## 9     0                                2       1       1        3        0
## 10    0                                2       0       1        1        0
## 11    0                                0       0       0        0        0
## 12    0                                0       0       0        0        0
##    Turkey Vietnam
## 1       0       3
## 2       0       3
## 3       0      29
## 4       0      20
## 5       0      61
## 6       0      19
## 7      12       0
## 8       4       0
## 9       0       8
## 10      0       5
## 11      0       5
## 12      0       5
names(BirdFlu)
##  [1] "Year"                             "Type"                            
##  [3] "Azerbaijan"                       "Bangladesh"                      
##  [5] "Cambodia"                         "China"                           
##  [7] "Djibouti"                         "Egypt"                           
##  [9] "Indonesia"                        "Iraq"                            
## [11] "Lao.People.s.Democratic.Republic" "Myanmar"                         
## [13] "Nigeria"                          "Pakistan"                        
## [15] "Thailand"                         "Turkey"                          
## [17] "Vietnam"
str(BirdFlu)
## 'data.frame':    12 obs. of  17 variables:
##  $ Year                            : int  2003 2003 2004 2004 2005 2005 2006 2006 2007 2007 ...
##  $ Type                            : chr  "Cases" "Deaths" "Cases" "Deaths" ...
##  $ Azerbaijan                      : int  0 0 0 0 0 0 8 5 0 0 ...
##  $ Bangladesh                      : int  0 0 0 0 0 0 0 0 0 0 ...
##  $ Cambodia                        : int  0 0 0 0 4 4 2 2 1 1 ...
##  $ China                           : int  1 1 0 0 8 5 13 8 5 3 ...
##  $ Djibouti                        : int  0 0 0 0 0 0 1 0 0 0 ...
##  $ Egypt                           : int  0 0 0 0 0 0 18 10 25 9 ...
##  $ Indonesia                       : int  0 0 0 0 20 13 55 45 42 37 ...
##  $ Iraq                            : int  0 0 0 0 0 0 3 2 0 0 ...
##  $ Lao.People.s.Democratic.Republic: int  0 0 0 0 0 0 0 0 2 2 ...
##  $ Myanmar                         : int  0 0 0 0 0 0 0 0 1 0 ...
##  $ Nigeria                         : int  0 0 0 0 0 0 0 0 1 1 ...
##  $ Pakistan                        : int  0 0 0 0 0 0 0 0 3 1 ...
##  $ Thailand                        : int  0 0 17 12 5 2 3 3 0 0 ...
##  $ Turkey                          : int  0 0 0 0 0 0 12 4 0 0 ...
##  $ Vietnam                         : int  3 3 29 20 61 19 0 0 8 5 ...

Now we identify the cases and deaths in 2003

BirdFlu[1:2,]
##   Year   Type Azerbaijan Bangladesh Cambodia China Djibouti Egypt Indonesia
## 1 2003  Cases          0          0        0     1        0     0         0
## 2 2003 Deaths          0          0        0     1        0     0         0
##   Iraq Lao.People.s.Democratic.Republic Myanmar Nigeria Pakistan Thailand
## 1    0                                0       0       0        0        0
## 2    0                                0       0       0        0        0
##   Turkey Vietnam
## 1      0       3
## 2      0       3

Now we create subsets of the data, seperating cases from deaths in 2003

bird03C = subset(BirdFlu, Year == 2003 & Type == "Cases")
bird03C
##   Year  Type Azerbaijan Bangladesh Cambodia China Djibouti Egypt Indonesia Iraq
## 1 2003 Cases          0          0        0     1        0     0         0    0
##   Lao.People.s.Democratic.Republic Myanmar Nigeria Pakistan Thailand Turkey
## 1                                0       0       0        0        0      0
##   Vietnam
## 1       3
bird03D = subset(BirdFlu, Year == 2003 & Type == "Deaths")
bird03D
##   Year   Type Azerbaijan Bangladesh Cambodia China Djibouti Egypt Indonesia
## 2 2003 Deaths          0          0        0     1        0     0         0
##   Iraq Lao.People.s.Democratic.Republic Myanmar Nigeria Pakistan Thailand
## 2    0                                0       0       0        0        0
##   Turkey Vietnam
## 2      0       3

Finally, to identify the most deaths in 2005 create one more value from the data and the ask for the max.

bird05D = BirdFlu[6, 3:17]
max(bird05D)
## [1] 19