The first dataset I analyzed was my own. I wanted to explore whether those who went out to eat consumed more calories than those who did not - broken down by age group and gender. I also wanted to explore the percentage of calories eaten out (for those who did) also by age group and gender.

calories <- read.csv('https://raw.githubusercontent.com/jeffnieman11/Data607_Project2/master/calories%20and%20restaurants.csv', header = TRUE, na.strings="")
calories
##    Gender      Age Sample.Size Percent.Reporting
## 1    Male   2 to 5         411                43
## 2    <NA>  6 to 11         590                38
## 3    <NA> 12 to 19         585                56
## 4    <NA> 20 to 39         882                67
## 5    <NA> 40 to 59         576                56
## 6    <NA>     60 +         756                51
## 7  Female   2 to 5         423                38
## 8    <NA>  6 to 11         556                46
## 9    <NA> 12 to 19         567                57
## 10   <NA> 20 to 39         832                61
## 11   <NA> 40 to 59         830                53
## 12   <NA>     60 +         745                43
##    Total.Intake.kcal.for.all.individuals
## 1                                   1648
## 2                                   2087
## 3                                   2531
## 4                                   2767
## 5                                   2613
## 6                                   2181
## 7                                   1520
## 8                                   1878
## 9                                   1809
## 10                                  2015
## 11                                  1829
## 12                                  1611
##    intake.kcal.from.restaurants.for.all.individuals
## 1                                               212
## 2                                               273
## 3                                               736
## 4                                               922
## 5                                               598
## 6                                               414
## 7                                               177
## 8                                               353
## 9                                               516
## 10                                              583
## 11                                              426
## 12                                              295
##    Percentage.from.Restaurants Total.intake.kcal.for.restaurant.consumers
## 1                           13                                       1646
## 2                           13                                       2128
## 3                           29                                       2766
## 4                           33                                       2816
## 5                           23                                       2672
## 6                           19                                       2236
## 7                           12                                       1573
## 8                           19                                       1972
## 9                           29                                       1837
## 10                          29                                       2086
## 11                          23                                       1946
## 12                          18                                       1725
##    Intake.kcal.from.restaurants.for.restaurant.consumers
## 1                                                    498
## 2                                                    726
## 3                                                   1315
## 4                                                   1386
## 5                                                   1076
## 6                                                    805
## 7                                                    465
## 8                                                    765
## 9                                                    906
## 10                                                   958
## 11                                                   811
## 12                                                   679
##    Percentage.from.restaurant.for.restaurant.consumers
## 1                                                   30
## 2                                                   34
## 3                                                   48
## 4                                                   49
## 5                                                   40
## 6                                                   36
## 7                                                   30
## 8                                                   39
## 9                                                   49
## 10                                                  46
## 11                                                  42
## 12                                                  39
##    Total.intake.kcal.for.non.consumers
## 1                                 1650
## 2                                 2062
## 3                                 2232
## 4                                 2671
## 5                                 2539
## 6                                 2121
## 7                                 1487
## 8                                 1797
## 9                                 1771
## 10                                1905
## 11                                1700
## 12                                1523
require(tidyr)
## Loading required package: tidyr
## Warning: package 'tidyr' was built under R version 3.2.3
require(zoo)
## Loading required package: zoo
## Warning: package 'zoo' was built under R version 3.2.3
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
require(dplyr)
## Loading required package: dplyr
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
require(ggplot2)
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 3.2.3
require(stringr)
## Loading required package: stringr
calories1 <- na.locf(calories) 
 
# Compare calories of those who eat out with those who do not
caloriesshort <- calories1[,c(1:5,8,11)]

colnames(caloriesshort) <- c("Gender", "Age", "Sample", "Percent.EatOut", "AvgCals.All", "AvgCals.EatOut", "AvgCals.NoEatOut")
caloriesshort$Sample <- as.numeric(as.character(caloriesshort$Sample))
caloriesshort$Percent.EatOut <- as.numeric((as.character(caloriesshort$Percent.EatOut)))
caloriesshort$AvgCals.All <- as.numeric(as.character(caloriesshort$AvgCals.All))
caloriesshort$AvgCals.EatOut <- as.numeric(as.character(caloriesshort$AvgCals.EatOut))
caloriesshort$AvgCals.NoEatOut <- as.numeric(as.character(caloriesshort$AvgCals.NoEatOut))

calories2 <- mutate(caloriesshort, Sample.EatOut =round(Sample*Percent.EatOut/100))
calories3 <- mutate(calories2, Sample.NoEatOut = Sample - Sample.EatOut)
calories4 <- mutate(calories3, TotalCals.EatOut = Sample.EatOut*AvgCals.EatOut)
calories5 <- mutate(calories4, TotalCals.NoEatOut = Sample.NoEatOut*AvgCals.NoEatOut)

#Create a ratio by the groups for calories of those who went out and those who did not, and plot to see who goes above 100% and compare.
calories6 <- calories5 %>%
    group_by(Gender)  %>%
    summarise(AvgCals.EatOut = sum(TotalCals.EatOut)/sum(Sample.EatOut), AvgCals.NoEatOut = sum(TotalCals.NoEatOut)/sum(Sample.NoEatOut))
calories6$Ratio <- calories6$AvgCals.EatOut/calories6$AvgCals.NoEatOut
calories6$Ratio <- as.numeric(calories6$Ratio)
calories6
## Source: local data frame [2 x 4]
## 
##   Gender AvgCals.EatOut AvgCals.NoEatOut    Ratio
##    (chr)          (dbl)            (dbl)    (dbl)
## 1 Female       1902.074         1690.649 1.125055
## 2   Male       2496.634         2212.769 1.128285
ggplot(calories6, aes(x=Gender, y=Ratio)) + geom_bar(stat = "identity", position = "dodge")

#  Conclusion : Both men and women eat more calories when they go out and the percentage of increase is nearly identical.

calories7 <- calories5 %>%
    group_by(Age)  %>%
    summarise(AvgCals.EatOut = sum(TotalCals.EatOut)/sum(Sample.EatOut), AvgCals.NoEatOut = sum(TotalCals.NoEatOut)/sum(Sample.NoEatOut))
calories7$Ratio <- calories7$AvgCals.EatOut/calories7$AvgCals.NoEatOut
calories7$Ratio <- as.numeric(calories7$Ratio)
calories7
## Source: local data frame [6 x 4]
## 
##        Age AvgCals.EatOut AvgCals.NoEatOut    Ratio
##      (chr)          (dbl)            (dbl)    (dbl)
## 1 12 to 19       2305.068         2007.481 1.148239
## 2   2 to 5       1611.228         1563.899 1.030263
## 3 20 to 39       2478.566         2267.449 1.093108
## 4 40 to 59       2253.337         2030.120 1.109953
## 5  6 to 11       2044.800         1942.631 1.052593
## 6     60 +       2004.385         1801.314 1.112735
ggplot(calories7, aes(x=Age, y=Ratio)) + geom_bar(stat="identity", position = "dodge")

#  Conclusion:  All age groups eat more calories when they go out - but only slightly for the 2 kid groups and highest for the teenage group 12-19.

#Compare % of calories from restaurants
calrest <- calories1[,c(1:4,8:10)]
colnames(calrest) <- c("Gender", "Age", "Sample", "Percent.EatOut", "AvgCals.EatOut", "AvgCals.FromEatOut","Percent.Cals.EatOut")
calrest$Sample <- as.numeric(as.character(calrest$Sample))
calrest$Percent.EatOut <- as.numeric((as.character(calrest$Percent.EatOut)))
calrest$AvgCals.EatOut <- as.numeric(as.character(calrest$AvgCals.EatOut))
calrest$AvgCals.FromEatOut <- as.numeric(as.character((calrest$AvgCals.FromEatOut)))

calrest1 <- mutate(calrest, Sample.EatOut =round(Sample*Percent.EatOut/100))
calrest2 <- mutate(calrest1, TotalCals.EatOut = Sample.EatOut*AvgCals.EatOut)
calrest3 <- mutate(calrest2, TotalCals.FromEatOut = Sample.EatOut*AvgCals.FromEatOut)
calrest3
##    Gender      Age Sample Percent.EatOut AvgCals.EatOut AvgCals.FromEatOut
## 1    Male   2 to 5    411             43           1646                498
## 2    Male  6 to 11    590             38           2128                726
## 3    Male 12 to 19    585             56           2766               1315
## 4    Male 20 to 39    882             67           2816               1386
## 5    Male 40 to 59    576             56           2672               1076
## 6    Male     60 +    756             51           2236                805
## 7  Female   2 to 5    423             38           1573                465
## 8  Female  6 to 11    556             46           1972                765
## 9  Female 12 to 19    567             57           1837                906
## 10 Female 20 to 39    832             61           2086                958
## 11 Female 40 to 59    830             53           1946                811
## 12 Female     60 +    745             43           1725                679
##    Percent.Cals.EatOut Sample.EatOut TotalCals.EatOut TotalCals.FromEatOut
## 1                   30           177           291342                88146
## 2                   34           224           476672               162624
## 3                   48           328           907248               431320
## 4                   49           591          1664256               819126
## 5                   40           323           863056               347548
## 6                   36           386           863096               310730
## 7                   30           161           253253                74865
## 8                   39           256           504832               195840
## 9                   49           323           593351               292638
## 10                  46           508          1059688               486664
## 11                  42           440           856240               356840
## 12                  39           320           552000               217280
calrest4 <- calrest3 %>%
  group_by(Gender) %>%
  summarise(Percent.Cals.EatOut = 100*sum(TotalCals.FromEatOut)/sum(TotalCals.EatOut))
calrest4
## Source: local data frame [2 x 2]
## 
##   Gender Percent.Cals.EatOut
##    (chr)               (dbl)
## 1 Female            42.52349
## 2   Male            42.62998
ggplot(calrest4, aes(x=Gender, y=Percent.Cals.EatOut)) + geom_bar(stat="identity", position = "dodge")

calrest5 <- calrest3 %>%
  group_by(Age) %>%
  summarise(Percent.Cals.EatOut = 100*sum(TotalCals.FromEatOut)/sum(TotalCals.EatOut))
calrest5
## Source: local data frame [6 x 2]
## 
##        Age Percent.Cals.EatOut
##      (chr)               (dbl)
## 1 12 to 19            48.24460
## 2   2 to 5            29.93252
## 3 20 to 39            47.93748
## 4 40 to 59            40.96956
## 5  6 to 11            36.52191
## 6     60 +            37.31266
ggplot(calrest5, aes(x=Age, y=Percent.Cals.EatOut)) + geom_bar(stat="identity", position = "dodge")

The second data I analyzed was from James on the relationship between college education and jobs. I also looked at the other variables for any relationship.

jobs <- read.csv('https://raw.githubusercontent.com/jeffnieman11/Data607_Project2/dea005e80fd96bd01fa1ac7cfafa0b027d973683/jobs%20and%20county.csv', header=TRUE)
jobs
##    County LandArea NatAmenity College1970 College1980 College1990
## 1 Autauga      599          4       0.064       0.121       0.145
## 2 Baldwin     1578          4       0.065       0.121       0.168
## 3 Barbour      891          4       0.073       0.092       0.118
## 4    Bibb      625          3       0.042       0.049       0.047
## 5  Blount      639          4       0.027       0.053       0.070
##   College2000 Jobs1970 Jobs1980 Jobs1990 Jobs2000
## 1       0.180     6853    11278    11471    16289
## 2       0.231    19749    27861    40809    70247
## 3       0.109     9448     9755    12163    15197
## 4       0.071     3965     4276     5564     6098
## 5       0.096     7587     9490    11811    16503
#  After downloading the data I used the gather function to tidy up the data and extracted only the numerical component for the year.

jobs1 <- gather(jobs, "Jobs", "n", 8:11)
jobs2 <- gather(jobs1, "College", "m", 4:7)
jobs2$Jobs <- str_extract_all(jobs2$Jobs, "[0-9]{4}")
jobs2$College <- str_extract_all(jobs2$College, "[0-9]{4}")
jobs2$College <- as.numeric(as.character(jobs2$College))
jobs2$Jobs <- as.numeric(as.character(jobs2$Jobs))
jobs2
##     County LandArea NatAmenity Jobs     n College     m
## 1  Autauga      599          4 1970  6853    1970 0.064
## 2  Baldwin     1578          4 1970 19749    1970 0.065
## 3  Barbour      891          4 1970  9448    1970 0.073
## 4     Bibb      625          3 1970  3965    1970 0.042
## 5   Blount      639          4 1970  7587    1970 0.027
## 6  Autauga      599          4 1980 11278    1970 0.064
## 7  Baldwin     1578          4 1980 27861    1970 0.065
## 8  Barbour      891          4 1980  9755    1970 0.073
## 9     Bibb      625          3 1980  4276    1970 0.042
## 10  Blount      639          4 1980  9490    1970 0.027
## 11 Autauga      599          4 1990 11471    1970 0.064
## 12 Baldwin     1578          4 1990 40809    1970 0.065
## 13 Barbour      891          4 1990 12163    1970 0.073
## 14    Bibb      625          3 1990  5564    1970 0.042
## 15  Blount      639          4 1990 11811    1970 0.027
## 16 Autauga      599          4 2000 16289    1970 0.064
## 17 Baldwin     1578          4 2000 70247    1970 0.065
## 18 Barbour      891          4 2000 15197    1970 0.073
## 19    Bibb      625          3 2000  6098    1970 0.042
## 20  Blount      639          4 2000 16503    1970 0.027
## 21 Autauga      599          4 1970  6853    1980 0.121
## 22 Baldwin     1578          4 1970 19749    1980 0.121
## 23 Barbour      891          4 1970  9448    1980 0.092
## 24    Bibb      625          3 1970  3965    1980 0.049
## 25  Blount      639          4 1970  7587    1980 0.053
## 26 Autauga      599          4 1980 11278    1980 0.121
## 27 Baldwin     1578          4 1980 27861    1980 0.121
## 28 Barbour      891          4 1980  9755    1980 0.092
## 29    Bibb      625          3 1980  4276    1980 0.049
## 30  Blount      639          4 1980  9490    1980 0.053
## 31 Autauga      599          4 1990 11471    1980 0.121
## 32 Baldwin     1578          4 1990 40809    1980 0.121
## 33 Barbour      891          4 1990 12163    1980 0.092
## 34    Bibb      625          3 1990  5564    1980 0.049
## 35  Blount      639          4 1990 11811    1980 0.053
## 36 Autauga      599          4 2000 16289    1980 0.121
## 37 Baldwin     1578          4 2000 70247    1980 0.121
## 38 Barbour      891          4 2000 15197    1980 0.092
## 39    Bibb      625          3 2000  6098    1980 0.049
## 40  Blount      639          4 2000 16503    1980 0.053
## 41 Autauga      599          4 1970  6853    1990 0.145
## 42 Baldwin     1578          4 1970 19749    1990 0.168
## 43 Barbour      891          4 1970  9448    1990 0.118
## 44    Bibb      625          3 1970  3965    1990 0.047
## 45  Blount      639          4 1970  7587    1990 0.070
## 46 Autauga      599          4 1980 11278    1990 0.145
## 47 Baldwin     1578          4 1980 27861    1990 0.168
## 48 Barbour      891          4 1980  9755    1990 0.118
## 49    Bibb      625          3 1980  4276    1990 0.047
## 50  Blount      639          4 1980  9490    1990 0.070
## 51 Autauga      599          4 1990 11471    1990 0.145
## 52 Baldwin     1578          4 1990 40809    1990 0.168
## 53 Barbour      891          4 1990 12163    1990 0.118
## 54    Bibb      625          3 1990  5564    1990 0.047
## 55  Blount      639          4 1990 11811    1990 0.070
## 56 Autauga      599          4 2000 16289    1990 0.145
## 57 Baldwin     1578          4 2000 70247    1990 0.168
## 58 Barbour      891          4 2000 15197    1990 0.118
## 59    Bibb      625          3 2000  6098    1990 0.047
## 60  Blount      639          4 2000 16503    1990 0.070
## 61 Autauga      599          4 1970  6853    2000 0.180
## 62 Baldwin     1578          4 1970 19749    2000 0.231
## 63 Barbour      891          4 1970  9448    2000 0.109
## 64    Bibb      625          3 1970  3965    2000 0.071
## 65  Blount      639          4 1970  7587    2000 0.096
## 66 Autauga      599          4 1980 11278    2000 0.180
## 67 Baldwin     1578          4 1980 27861    2000 0.231
## 68 Barbour      891          4 1980  9755    2000 0.109
## 69    Bibb      625          3 1980  4276    2000 0.071
## 70  Blount      639          4 1980  9490    2000 0.096
## 71 Autauga      599          4 1990 11471    2000 0.180
## 72 Baldwin     1578          4 1990 40809    2000 0.231
## 73 Barbour      891          4 1990 12163    2000 0.109
## 74    Bibb      625          3 1990  5564    2000 0.071
## 75  Blount      639          4 1990 11811    2000 0.096
## 76 Autauga      599          4 2000 16289    2000 0.180
## 77 Baldwin     1578          4 2000 70247    2000 0.231
## 78 Barbour      891          4 2000 15197    2000 0.109
## 79    Bibb      625          3 2000  6098    2000 0.071
## 80  Blount      639          4 2000 16503    2000 0.096
#  I then minimized the data to those where the years for job count and college percentage were the same and added some column names.

jobs3 <- subset(jobs2, Jobs==College)
jobs4 <- jobs3[,c(1:5,7)]
colnames(jobs4) <- c("County", "LandArea", "NatAmenity", "Year", "Jobs","College" )
jobs4
##     County LandArea NatAmenity Year  Jobs College
## 1  Autauga      599          4 1970  6853   0.064
## 2  Baldwin     1578          4 1970 19749   0.065
## 3  Barbour      891          4 1970  9448   0.073
## 4     Bibb      625          3 1970  3965   0.042
## 5   Blount      639          4 1970  7587   0.027
## 26 Autauga      599          4 1980 11278   0.121
## 27 Baldwin     1578          4 1980 27861   0.121
## 28 Barbour      891          4 1980  9755   0.092
## 29    Bibb      625          3 1980  4276   0.049
## 30  Blount      639          4 1980  9490   0.053
## 51 Autauga      599          4 1990 11471   0.145
## 52 Baldwin     1578          4 1990 40809   0.168
## 53 Barbour      891          4 1990 12163   0.118
## 54    Bibb      625          3 1990  5564   0.047
## 55  Blount      639          4 1990 11811   0.070
## 76 Autauga      599          4 2000 16289   0.180
## 77 Baldwin     1578          4 2000 70247   0.231
## 78 Barbour      891          4 2000 15197   0.109
## 79    Bibb      625          3 2000  6098   0.071
## 80  Blount      639          4 2000 16503   0.096
#  I then plotted to see the relationships between college and jobs, Land area and jobs and natural amenity and jobs.

ggplot(jobs4, aes(College, Jobs)) + geom_line()

ggplot(jobs4, aes(LandArea, Jobs)) + geom_point()

ggplot(jobs4, aes(NatAmenity, Jobs)) + geom_point()

# Conclusion - the graph shows a general upward trend for job growth as college education increases.  Land area is less conclusive although the largest county has the highest rate in each year.  Ironically the county with the natural amenity has the lowest jobs.  

My final analysis was the data provided by Valerie Briot. I looked at the highest average downloads for apps - for free apps and for paid apps, along with the average downloads for each app across both platforms and for each platform.

apps <- read.csv('https://raw.githubusercontent.com/jeffnieman11/Data607_Project2/master/Mobile%20App%20downloads.csv', header=TRUE, skip=2)
apps
##                      App.Name Type Paid.Free Release.Date X2010 X2011
## 1            Candy Crush Saga Game      Free    4/12/2012    NA    NA
## 2                 Fruit Ninja Game      Free    4/21/2010     4     8
## 3                 Angry Birds Game      Free   12/11/2009    10   124
## 4              Subway Surfers Game      Free    5/24/2012    NA    NA
## 5  Despicable Me: Minion Rush Game      Free    6/10/2013    NA    NA
## 6              Clash of Clans Game      Free     8/2/2012    NA    NA
## 7                  Temple Run Game      Free     8/4/2011    NA    18
## 8             Angry Birds Rio Game      Free    3/22/2011    NA   104
## 9                Temple Run 2 Game      Free    1/16/2013    NA    NA
## 10         Words With Friends Game      Free        9-Jul   143   156
## 11  Minecraft: Pocket Edition Game      Paid    11/7/2011    NA     4
## 12                   NBA 2K16 Game      Paid   10/14/2015    NA    NA
##    X2012 X2013 X2014 X2015 Release.Date.1 X2010.1 X2011.1 X2012.1 X2013.1
## 1      8    56    60    76      11/4/2012      NA      NA       2      53
## 2     58   102   126   148      7/10/2010       1       9      64     108
## 3    320   547   648   627     11/19/2010       2     108     312     538
## 4     23   123   202   303      5/24/2012      NA      NA      26     128
## 5     NA    16    58   128      6/10/2013      NA      NA      NA      18
## 6     24   123   234   345      10/7/2013      NA      NA      NA       4
## 7    102   246   306   378      3/27/2012      NA      NA     108     254
## 8    204   382   485   324      3/22/2011      NA     108     205     398
## 9     NA   230   403   503      1/16/2013      NA      NA      NA     253
## 10   100    93    85    86          9-Jul     146     173     112     105
## 11   120   240   320   340      11/7/2011      NA       8     154     285
## 12    NA    NA    NA   245     10/14/2015      NA      NA      NA      NA
##    X2014.1 X2015.1
## 1       64      72
## 2      132     165
## 3      647     656
## 4      236     329
## 5       64     294
## 6      143     256
## 7      302     402
## 8      476     389
## 9      493     523
## 10      95      92
## 11     369     352
## 12      NA     345
# After downloading the data I began by creating separate data frames for apple and android platforms.

appleapps <- apps[,1:10]
appleapps
##                      App.Name Type Paid.Free Release.Date X2010 X2011
## 1            Candy Crush Saga Game      Free    4/12/2012    NA    NA
## 2                 Fruit Ninja Game      Free    4/21/2010     4     8
## 3                 Angry Birds Game      Free   12/11/2009    10   124
## 4              Subway Surfers Game      Free    5/24/2012    NA    NA
## 5  Despicable Me: Minion Rush Game      Free    6/10/2013    NA    NA
## 6              Clash of Clans Game      Free     8/2/2012    NA    NA
## 7                  Temple Run Game      Free     8/4/2011    NA    18
## 8             Angry Birds Rio Game      Free    3/22/2011    NA   104
## 9                Temple Run 2 Game      Free    1/16/2013    NA    NA
## 10         Words With Friends Game      Free        9-Jul   143   156
## 11  Minecraft: Pocket Edition Game      Paid    11/7/2011    NA     4
## 12                   NBA 2K16 Game      Paid   10/14/2015    NA    NA
##    X2012 X2013 X2014 X2015
## 1      8    56    60    76
## 2     58   102   126   148
## 3    320   547   648   627
## 4     23   123   202   303
## 5     NA    16    58   128
## 6     24   123   234   345
## 7    102   246   306   378
## 8    204   382   485   324
## 9     NA   230   403   503
## 10   100    93    85    86
## 11   120   240   320   340
## 12    NA    NA    NA   245
googleapps <- apps[,c(1:3,11:17)]
googleapps
##                      App.Name Type Paid.Free Release.Date.1 X2010.1
## 1            Candy Crush Saga Game      Free      11/4/2012      NA
## 2                 Fruit Ninja Game      Free      7/10/2010       1
## 3                 Angry Birds Game      Free     11/19/2010       2
## 4              Subway Surfers Game      Free      5/24/2012      NA
## 5  Despicable Me: Minion Rush Game      Free      6/10/2013      NA
## 6              Clash of Clans Game      Free      10/7/2013      NA
## 7                  Temple Run Game      Free      3/27/2012      NA
## 8             Angry Birds Rio Game      Free      3/22/2011      NA
## 9                Temple Run 2 Game      Free      1/16/2013      NA
## 10         Words With Friends Game      Free          9-Jul     146
## 11  Minecraft: Pocket Edition Game      Paid      11/7/2011      NA
## 12                   NBA 2K16 Game      Paid     10/14/2015      NA
##    X2011.1 X2012.1 X2013.1 X2014.1 X2015.1
## 1       NA       2      53      64      72
## 2        9      64     108     132     165
## 3      108     312     538     647     656
## 4       NA      26     128     236     329
## 5       NA      NA      18      64     294
## 6       NA      NA       4     143     256
## 7       NA     108     254     302     402
## 8      108     205     398     476     389
## 9       NA      NA     253     493     523
## 10     173     112     105      95      92
## 11       8     154     285     369     352
## 12      NA      NA      NA      NA     345
# For the apple apps I made the data tidy.

appleapp1 <- gather(appleapps, "Year", "Downloads", 5:10)
appleapp1$Year <- str_extract_all(appleapp1$Year, "[0-9]{4}")
appleapp1$Source <- "Apple Store"
colnames(appleapp1) <- c("App.Name", "Type", "Paid.Free", "Release.Date", "Year", "Downloads", "Source")
appleapp1$Release.Date <- as.character.Date(appleapp1$Release.Date)

# I then summarized the data for average downloads in the apple platforms (fulfilling the assignment request).

appleapp2 <- appleapp1 %>%
  group_by(App.Name) %>%
  summarise(Avg.Downloads = mean(Downloads, na.rm = TRUE))
appleapp2
## Source: local data frame [12 x 2]
## 
##                      App.Name Avg.Downloads
##                        (fctr)         (dbl)
## 1                 Angry Birds     379.33333
## 2             Angry Birds Rio     299.80000
## 3            Candy Crush Saga      50.00000
## 4              Clash of Clans     181.50000
## 5  Despicable Me: Minion Rush      67.33333
## 6                 Fruit Ninja      74.33333
## 7   Minecraft: Pocket Edition     204.80000
## 8                    NBA 2K16     245.00000
## 9              Subway Surfers     162.75000
## 10                 Temple Run     210.00000
## 11               Temple Run 2     378.66667
## 12         Words With Friends     110.50000
#  For the android apps I once again made the data tidy.

googleapp1 <- gather(googleapps, "Year", "Downloads", 5:10)
googleapp1$Year <- str_extract_all(googleapp1$Year, "[0-9]{4}")
googleapp1$Source <- "Google Play"
colnames(googleapp1) <- c("App.Name", "Type", "Paid.Free", "Release.Date", "Year", "Downloads", "Source")
googleapp1$Release.Date <- as.character.Date(googleapp1$Release.Date)

#  I then summarized the data for average downloads in the android platforms (again fulfilling the assignment request).

googleapp2 <- googleapp1 %>%
  group_by(App.Name) %>%
  summarise(Avg.Downloads = mean(Downloads, na.rm = TRUE))
googleapp2
## Source: local data frame [12 x 2]
## 
##                      App.Name Avg.Downloads
##                        (fctr)         (dbl)
## 1                 Angry Birds     377.16667
## 2             Angry Birds Rio     315.20000
## 3            Candy Crush Saga      47.75000
## 4              Clash of Clans     134.33333
## 5  Despicable Me: Minion Rush     125.33333
## 6                 Fruit Ninja      79.83333
## 7   Minecraft: Pocket Edition     233.60000
## 8                    NBA 2K16     345.00000
## 9              Subway Surfers     179.75000
## 10                 Temple Run     266.50000
## 11               Temple Run 2     423.00000
## 12         Words With Friends     120.50000
#  I combined the two data frames into one and summarized the average downloads for each app with both platforms combined (fulfilling the assignment request for across providers).

apps1 <- rbind(googleapp1,appleapp1)
apps1
##                       App.Name Type Paid.Free Release.Date Year Downloads
## 1             Candy Crush Saga Game      Free   11/4/2012  2010        NA
## 2                  Fruit Ninja Game      Free   7/10/2010  2010         1
## 3                  Angry Birds Game      Free   11/19/2010 2010         2
## 4               Subway Surfers Game      Free   5/24/2012  2010        NA
## 5   Despicable Me: Minion Rush Game      Free   6/10/2013  2010        NA
## 6               Clash of Clans Game      Free   10/7/2013  2010        NA
## 7                   Temple Run Game      Free   3/27/2012  2010        NA
## 8              Angry Birds Rio Game      Free   3/22/2011  2010        NA
## 9                 Temple Run 2 Game      Free   1/16/2013  2010        NA
## 10          Words With Friends Game      Free   9-Jul      2010       146
## 11   Minecraft: Pocket Edition Game      Paid   11/7/2011  2010        NA
## 12                    NBA 2K16 Game      Paid   10/14/2015 2010        NA
## 13            Candy Crush Saga Game      Free   11/4/2012  2011        NA
## 14                 Fruit Ninja Game      Free   7/10/2010  2011         9
## 15                 Angry Birds Game      Free   11/19/2010 2011       108
## 16              Subway Surfers Game      Free   5/24/2012  2011        NA
## 17  Despicable Me: Minion Rush Game      Free   6/10/2013  2011        NA
## 18              Clash of Clans Game      Free   10/7/2013  2011        NA
## 19                  Temple Run Game      Free   3/27/2012  2011        NA
## 20             Angry Birds Rio Game      Free   3/22/2011  2011       108
## 21                Temple Run 2 Game      Free   1/16/2013  2011        NA
## 22          Words With Friends Game      Free   9-Jul      2011       173
## 23   Minecraft: Pocket Edition Game      Paid   11/7/2011  2011         8
## 24                    NBA 2K16 Game      Paid   10/14/2015 2011        NA
## 25            Candy Crush Saga Game      Free   11/4/2012  2012         2
## 26                 Fruit Ninja Game      Free   7/10/2010  2012        64
## 27                 Angry Birds Game      Free   11/19/2010 2012       312
## 28              Subway Surfers Game      Free   5/24/2012  2012        26
## 29  Despicable Me: Minion Rush Game      Free   6/10/2013  2012        NA
## 30              Clash of Clans Game      Free   10/7/2013  2012        NA
## 31                  Temple Run Game      Free   3/27/2012  2012       108
## 32             Angry Birds Rio Game      Free   3/22/2011  2012       205
## 33                Temple Run 2 Game      Free   1/16/2013  2012        NA
## 34          Words With Friends Game      Free   9-Jul      2012       112
## 35   Minecraft: Pocket Edition Game      Paid   11/7/2011  2012       154
## 36                    NBA 2K16 Game      Paid   10/14/2015 2012        NA
## 37            Candy Crush Saga Game      Free   11/4/2012  2013        53
## 38                 Fruit Ninja Game      Free   7/10/2010  2013       108
## 39                 Angry Birds Game      Free   11/19/2010 2013       538
## 40              Subway Surfers Game      Free   5/24/2012  2013       128
## 41  Despicable Me: Minion Rush Game      Free   6/10/2013  2013        18
## 42              Clash of Clans Game      Free   10/7/2013  2013         4
## 43                  Temple Run Game      Free   3/27/2012  2013       254
## 44             Angry Birds Rio Game      Free   3/22/2011  2013       398
## 45                Temple Run 2 Game      Free   1/16/2013  2013       253
## 46          Words With Friends Game      Free   9-Jul      2013       105
## 47   Minecraft: Pocket Edition Game      Paid   11/7/2011  2013       285
## 48                    NBA 2K16 Game      Paid   10/14/2015 2013        NA
## 49            Candy Crush Saga Game      Free   11/4/2012  2014        64
## 50                 Fruit Ninja Game      Free   7/10/2010  2014       132
## 51                 Angry Birds Game      Free   11/19/2010 2014       647
## 52              Subway Surfers Game      Free   5/24/2012  2014       236
## 53  Despicable Me: Minion Rush Game      Free   6/10/2013  2014        64
## 54              Clash of Clans Game      Free   10/7/2013  2014       143
## 55                  Temple Run Game      Free   3/27/2012  2014       302
## 56             Angry Birds Rio Game      Free   3/22/2011  2014       476
## 57                Temple Run 2 Game      Free   1/16/2013  2014       493
## 58          Words With Friends Game      Free   9-Jul      2014        95
## 59   Minecraft: Pocket Edition Game      Paid   11/7/2011  2014       369
## 60                    NBA 2K16 Game      Paid   10/14/2015 2014        NA
## 61            Candy Crush Saga Game      Free   11/4/2012  2015        72
## 62                 Fruit Ninja Game      Free   7/10/2010  2015       165
## 63                 Angry Birds Game      Free   11/19/2010 2015       656
## 64              Subway Surfers Game      Free   5/24/2012  2015       329
## 65  Despicable Me: Minion Rush Game      Free   6/10/2013  2015       294
## 66              Clash of Clans Game      Free   10/7/2013  2015       256
## 67                  Temple Run Game      Free   3/27/2012  2015       402
## 68             Angry Birds Rio Game      Free   3/22/2011  2015       389
## 69                Temple Run 2 Game      Free   1/16/2013  2015       523
## 70          Words With Friends Game      Free   9-Jul      2015        92
## 71   Minecraft: Pocket Edition Game      Paid   11/7/2011  2015       352
## 72                    NBA 2K16 Game      Paid   10/14/2015 2015       345
## 73            Candy Crush Saga Game      Free   4/12/2012  2010        NA
## 74                 Fruit Ninja Game      Free   4/21/2010  2010         4
## 75                 Angry Birds Game      Free   12/11/2009 2010        10
## 76              Subway Surfers Game      Free   5/24/2012  2010        NA
## 77  Despicable Me: Minion Rush Game      Free   6/10/2013  2010        NA
## 78              Clash of Clans Game      Free   8/2/2012   2010        NA
## 79                  Temple Run Game      Free   8/4/2011   2010        NA
## 80             Angry Birds Rio Game      Free   3/22/2011  2010        NA
## 81                Temple Run 2 Game      Free   1/16/2013  2010        NA
## 82          Words With Friends Game      Free   9-Jul      2010       143
## 83   Minecraft: Pocket Edition Game      Paid   11/7/2011  2010        NA
## 84                    NBA 2K16 Game      Paid   10/14/2015 2010        NA
## 85            Candy Crush Saga Game      Free   4/12/2012  2011        NA
## 86                 Fruit Ninja Game      Free   4/21/2010  2011         8
## 87                 Angry Birds Game      Free   12/11/2009 2011       124
## 88              Subway Surfers Game      Free   5/24/2012  2011        NA
## 89  Despicable Me: Minion Rush Game      Free   6/10/2013  2011        NA
## 90              Clash of Clans Game      Free   8/2/2012   2011        NA
## 91                  Temple Run Game      Free   8/4/2011   2011        18
## 92             Angry Birds Rio Game      Free   3/22/2011  2011       104
## 93                Temple Run 2 Game      Free   1/16/2013  2011        NA
## 94          Words With Friends Game      Free   9-Jul      2011       156
## 95   Minecraft: Pocket Edition Game      Paid   11/7/2011  2011         4
## 96                    NBA 2K16 Game      Paid   10/14/2015 2011        NA
## 97            Candy Crush Saga Game      Free   4/12/2012  2012         8
## 98                 Fruit Ninja Game      Free   4/21/2010  2012        58
## 99                 Angry Birds Game      Free   12/11/2009 2012       320
## 100             Subway Surfers Game      Free   5/24/2012  2012        23
## 101 Despicable Me: Minion Rush Game      Free   6/10/2013  2012        NA
## 102             Clash of Clans Game      Free   8/2/2012   2012        24
## 103                 Temple Run Game      Free   8/4/2011   2012       102
## 104            Angry Birds Rio Game      Free   3/22/2011  2012       204
## 105               Temple Run 2 Game      Free   1/16/2013  2012        NA
## 106         Words With Friends Game      Free   9-Jul      2012       100
## 107  Minecraft: Pocket Edition Game      Paid   11/7/2011  2012       120
## 108                   NBA 2K16 Game      Paid   10/14/2015 2012        NA
## 109           Candy Crush Saga Game      Free   4/12/2012  2013        56
## 110                Fruit Ninja Game      Free   4/21/2010  2013       102
## 111                Angry Birds Game      Free   12/11/2009 2013       547
## 112             Subway Surfers Game      Free   5/24/2012  2013       123
## 113 Despicable Me: Minion Rush Game      Free   6/10/2013  2013        16
## 114             Clash of Clans Game      Free   8/2/2012   2013       123
## 115                 Temple Run Game      Free   8/4/2011   2013       246
## 116            Angry Birds Rio Game      Free   3/22/2011  2013       382
## 117               Temple Run 2 Game      Free   1/16/2013  2013       230
## 118         Words With Friends Game      Free   9-Jul      2013        93
## 119  Minecraft: Pocket Edition Game      Paid   11/7/2011  2013       240
## 120                   NBA 2K16 Game      Paid   10/14/2015 2013        NA
## 121           Candy Crush Saga Game      Free   4/12/2012  2014        60
## 122                Fruit Ninja Game      Free   4/21/2010  2014       126
## 123                Angry Birds Game      Free   12/11/2009 2014       648
## 124             Subway Surfers Game      Free   5/24/2012  2014       202
## 125 Despicable Me: Minion Rush Game      Free   6/10/2013  2014        58
## 126             Clash of Clans Game      Free   8/2/2012   2014       234
## 127                 Temple Run Game      Free   8/4/2011   2014       306
## 128            Angry Birds Rio Game      Free   3/22/2011  2014       485
## 129               Temple Run 2 Game      Free   1/16/2013  2014       403
## 130         Words With Friends Game      Free   9-Jul      2014        85
## 131  Minecraft: Pocket Edition Game      Paid   11/7/2011  2014       320
## 132                   NBA 2K16 Game      Paid   10/14/2015 2014        NA
## 133           Candy Crush Saga Game      Free   4/12/2012  2015        76
## 134                Fruit Ninja Game      Free   4/21/2010  2015       148
## 135                Angry Birds Game      Free   12/11/2009 2015       627
## 136             Subway Surfers Game      Free   5/24/2012  2015       303
## 137 Despicable Me: Minion Rush Game      Free   6/10/2013  2015       128
## 138             Clash of Clans Game      Free   8/2/2012   2015       345
## 139                 Temple Run Game      Free   8/4/2011   2015       378
## 140            Angry Birds Rio Game      Free   3/22/2011  2015       324
## 141               Temple Run 2 Game      Free   1/16/2013  2015       503
## 142         Words With Friends Game      Free   9-Jul      2015        86
## 143  Minecraft: Pocket Edition Game      Paid   11/7/2011  2015       340
## 144                   NBA 2K16 Game      Paid   10/14/2015 2015       245
##          Source
## 1   Google Play
## 2   Google Play
## 3   Google Play
## 4   Google Play
## 5   Google Play
## 6   Google Play
## 7   Google Play
## 8   Google Play
## 9   Google Play
## 10  Google Play
## 11  Google Play
## 12  Google Play
## 13  Google Play
## 14  Google Play
## 15  Google Play
## 16  Google Play
## 17  Google Play
## 18  Google Play
## 19  Google Play
## 20  Google Play
## 21  Google Play
## 22  Google Play
## 23  Google Play
## 24  Google Play
## 25  Google Play
## 26  Google Play
## 27  Google Play
## 28  Google Play
## 29  Google Play
## 30  Google Play
## 31  Google Play
## 32  Google Play
## 33  Google Play
## 34  Google Play
## 35  Google Play
## 36  Google Play
## 37  Google Play
## 38  Google Play
## 39  Google Play
## 40  Google Play
## 41  Google Play
## 42  Google Play
## 43  Google Play
## 44  Google Play
## 45  Google Play
## 46  Google Play
## 47  Google Play
## 48  Google Play
## 49  Google Play
## 50  Google Play
## 51  Google Play
## 52  Google Play
## 53  Google Play
## 54  Google Play
## 55  Google Play
## 56  Google Play
## 57  Google Play
## 58  Google Play
## 59  Google Play
## 60  Google Play
## 61  Google Play
## 62  Google Play
## 63  Google Play
## 64  Google Play
## 65  Google Play
## 66  Google Play
## 67  Google Play
## 68  Google Play
## 69  Google Play
## 70  Google Play
## 71  Google Play
## 72  Google Play
## 73  Apple Store
## 74  Apple Store
## 75  Apple Store
## 76  Apple Store
## 77  Apple Store
## 78  Apple Store
## 79  Apple Store
## 80  Apple Store
## 81  Apple Store
## 82  Apple Store
## 83  Apple Store
## 84  Apple Store
## 85  Apple Store
## 86  Apple Store
## 87  Apple Store
## 88  Apple Store
## 89  Apple Store
## 90  Apple Store
## 91  Apple Store
## 92  Apple Store
## 93  Apple Store
## 94  Apple Store
## 95  Apple Store
## 96  Apple Store
## 97  Apple Store
## 98  Apple Store
## 99  Apple Store
## 100 Apple Store
## 101 Apple Store
## 102 Apple Store
## 103 Apple Store
## 104 Apple Store
## 105 Apple Store
## 106 Apple Store
## 107 Apple Store
## 108 Apple Store
## 109 Apple Store
## 110 Apple Store
## 111 Apple Store
## 112 Apple Store
## 113 Apple Store
## 114 Apple Store
## 115 Apple Store
## 116 Apple Store
## 117 Apple Store
## 118 Apple Store
## 119 Apple Store
## 120 Apple Store
## 121 Apple Store
## 122 Apple Store
## 123 Apple Store
## 124 Apple Store
## 125 Apple Store
## 126 Apple Store
## 127 Apple Store
## 128 Apple Store
## 129 Apple Store
## 130 Apple Store
## 131 Apple Store
## 132 Apple Store
## 133 Apple Store
## 134 Apple Store
## 135 Apple Store
## 136 Apple Store
## 137 Apple Store
## 138 Apple Store
## 139 Apple Store
## 140 Apple Store
## 141 Apple Store
## 142 Apple Store
## 143 Apple Store
## 144 Apple Store
apps2 <- apps1 %>%
  group_by(App.Name) %>%
  summarise(Avg.Downloads = mean(Downloads, na.rm = TRUE)) 

apps2
## Source: local data frame [12 x 2]
## 
##                      App.Name Avg.Downloads
##                        (fctr)         (dbl)
## 1                 Angry Birds     378.25000
## 2             Angry Birds Rio     307.50000
## 3            Candy Crush Saga      48.87500
## 4              Clash of Clans     161.28571
## 5  Despicable Me: Minion Rush      96.33333
## 6                 Fruit Ninja      77.08333
## 7   Minecraft: Pocket Edition     219.20000
## 8                    NBA 2K16     295.00000
## 9              Subway Surfers     171.25000
## 10                 Temple Run     235.11111
## 11               Temple Run 2     400.83333
## 12         Words With Friends     115.50000
#  I then created a subet of the data for free apps and summarized the average downloads for each free app.

freeapps <- subset(apps1, Paid.Free == "Free")
freeapps
##                       App.Name Type Paid.Free Release.Date Year Downloads
## 1             Candy Crush Saga Game      Free   11/4/2012  2010        NA
## 2                  Fruit Ninja Game      Free   7/10/2010  2010         1
## 3                  Angry Birds Game      Free   11/19/2010 2010         2
## 4               Subway Surfers Game      Free   5/24/2012  2010        NA
## 5   Despicable Me: Minion Rush Game      Free   6/10/2013  2010        NA
## 6               Clash of Clans Game      Free   10/7/2013  2010        NA
## 7                   Temple Run Game      Free   3/27/2012  2010        NA
## 8              Angry Birds Rio Game      Free   3/22/2011  2010        NA
## 9                 Temple Run 2 Game      Free   1/16/2013  2010        NA
## 10          Words With Friends Game      Free   9-Jul      2010       146
## 13            Candy Crush Saga Game      Free   11/4/2012  2011        NA
## 14                 Fruit Ninja Game      Free   7/10/2010  2011         9
## 15                 Angry Birds Game      Free   11/19/2010 2011       108
## 16              Subway Surfers Game      Free   5/24/2012  2011        NA
## 17  Despicable Me: Minion Rush Game      Free   6/10/2013  2011        NA
## 18              Clash of Clans Game      Free   10/7/2013  2011        NA
## 19                  Temple Run Game      Free   3/27/2012  2011        NA
## 20             Angry Birds Rio Game      Free   3/22/2011  2011       108
## 21                Temple Run 2 Game      Free   1/16/2013  2011        NA
## 22          Words With Friends Game      Free   9-Jul      2011       173
## 25            Candy Crush Saga Game      Free   11/4/2012  2012         2
## 26                 Fruit Ninja Game      Free   7/10/2010  2012        64
## 27                 Angry Birds Game      Free   11/19/2010 2012       312
## 28              Subway Surfers Game      Free   5/24/2012  2012        26
## 29  Despicable Me: Minion Rush Game      Free   6/10/2013  2012        NA
## 30              Clash of Clans Game      Free   10/7/2013  2012        NA
## 31                  Temple Run Game      Free   3/27/2012  2012       108
## 32             Angry Birds Rio Game      Free   3/22/2011  2012       205
## 33                Temple Run 2 Game      Free   1/16/2013  2012        NA
## 34          Words With Friends Game      Free   9-Jul      2012       112
## 37            Candy Crush Saga Game      Free   11/4/2012  2013        53
## 38                 Fruit Ninja Game      Free   7/10/2010  2013       108
## 39                 Angry Birds Game      Free   11/19/2010 2013       538
## 40              Subway Surfers Game      Free   5/24/2012  2013       128
## 41  Despicable Me: Minion Rush Game      Free   6/10/2013  2013        18
## 42              Clash of Clans Game      Free   10/7/2013  2013         4
## 43                  Temple Run Game      Free   3/27/2012  2013       254
## 44             Angry Birds Rio Game      Free   3/22/2011  2013       398
## 45                Temple Run 2 Game      Free   1/16/2013  2013       253
## 46          Words With Friends Game      Free   9-Jul      2013       105
## 49            Candy Crush Saga Game      Free   11/4/2012  2014        64
## 50                 Fruit Ninja Game      Free   7/10/2010  2014       132
## 51                 Angry Birds Game      Free   11/19/2010 2014       647
## 52              Subway Surfers Game      Free   5/24/2012  2014       236
## 53  Despicable Me: Minion Rush Game      Free   6/10/2013  2014        64
## 54              Clash of Clans Game      Free   10/7/2013  2014       143
## 55                  Temple Run Game      Free   3/27/2012  2014       302
## 56             Angry Birds Rio Game      Free   3/22/2011  2014       476
## 57                Temple Run 2 Game      Free   1/16/2013  2014       493
## 58          Words With Friends Game      Free   9-Jul      2014        95
## 61            Candy Crush Saga Game      Free   11/4/2012  2015        72
## 62                 Fruit Ninja Game      Free   7/10/2010  2015       165
## 63                 Angry Birds Game      Free   11/19/2010 2015       656
## 64              Subway Surfers Game      Free   5/24/2012  2015       329
## 65  Despicable Me: Minion Rush Game      Free   6/10/2013  2015       294
## 66              Clash of Clans Game      Free   10/7/2013  2015       256
## 67                  Temple Run Game      Free   3/27/2012  2015       402
## 68             Angry Birds Rio Game      Free   3/22/2011  2015       389
## 69                Temple Run 2 Game      Free   1/16/2013  2015       523
## 70          Words With Friends Game      Free   9-Jul      2015        92
## 73            Candy Crush Saga Game      Free   4/12/2012  2010        NA
## 74                 Fruit Ninja Game      Free   4/21/2010  2010         4
## 75                 Angry Birds Game      Free   12/11/2009 2010        10
## 76              Subway Surfers Game      Free   5/24/2012  2010        NA
## 77  Despicable Me: Minion Rush Game      Free   6/10/2013  2010        NA
## 78              Clash of Clans Game      Free   8/2/2012   2010        NA
## 79                  Temple Run Game      Free   8/4/2011   2010        NA
## 80             Angry Birds Rio Game      Free   3/22/2011  2010        NA
## 81                Temple Run 2 Game      Free   1/16/2013  2010        NA
## 82          Words With Friends Game      Free   9-Jul      2010       143
## 85            Candy Crush Saga Game      Free   4/12/2012  2011        NA
## 86                 Fruit Ninja Game      Free   4/21/2010  2011         8
## 87                 Angry Birds Game      Free   12/11/2009 2011       124
## 88              Subway Surfers Game      Free   5/24/2012  2011        NA
## 89  Despicable Me: Minion Rush Game      Free   6/10/2013  2011        NA
## 90              Clash of Clans Game      Free   8/2/2012   2011        NA
## 91                  Temple Run Game      Free   8/4/2011   2011        18
## 92             Angry Birds Rio Game      Free   3/22/2011  2011       104
## 93                Temple Run 2 Game      Free   1/16/2013  2011        NA
## 94          Words With Friends Game      Free   9-Jul      2011       156
## 97            Candy Crush Saga Game      Free   4/12/2012  2012         8
## 98                 Fruit Ninja Game      Free   4/21/2010  2012        58
## 99                 Angry Birds Game      Free   12/11/2009 2012       320
## 100             Subway Surfers Game      Free   5/24/2012  2012        23
## 101 Despicable Me: Minion Rush Game      Free   6/10/2013  2012        NA
## 102             Clash of Clans Game      Free   8/2/2012   2012        24
## 103                 Temple Run Game      Free   8/4/2011   2012       102
## 104            Angry Birds Rio Game      Free   3/22/2011  2012       204
## 105               Temple Run 2 Game      Free   1/16/2013  2012        NA
## 106         Words With Friends Game      Free   9-Jul      2012       100
## 109           Candy Crush Saga Game      Free   4/12/2012  2013        56
## 110                Fruit Ninja Game      Free   4/21/2010  2013       102
## 111                Angry Birds Game      Free   12/11/2009 2013       547
## 112             Subway Surfers Game      Free   5/24/2012  2013       123
## 113 Despicable Me: Minion Rush Game      Free   6/10/2013  2013        16
## 114             Clash of Clans Game      Free   8/2/2012   2013       123
## 115                 Temple Run Game      Free   8/4/2011   2013       246
## 116            Angry Birds Rio Game      Free   3/22/2011  2013       382
## 117               Temple Run 2 Game      Free   1/16/2013  2013       230
## 118         Words With Friends Game      Free   9-Jul      2013        93
## 121           Candy Crush Saga Game      Free   4/12/2012  2014        60
## 122                Fruit Ninja Game      Free   4/21/2010  2014       126
## 123                Angry Birds Game      Free   12/11/2009 2014       648
## 124             Subway Surfers Game      Free   5/24/2012  2014       202
## 125 Despicable Me: Minion Rush Game      Free   6/10/2013  2014        58
## 126             Clash of Clans Game      Free   8/2/2012   2014       234
## 127                 Temple Run Game      Free   8/4/2011   2014       306
## 128            Angry Birds Rio Game      Free   3/22/2011  2014       485
## 129               Temple Run 2 Game      Free   1/16/2013  2014       403
## 130         Words With Friends Game      Free   9-Jul      2014        85
## 133           Candy Crush Saga Game      Free   4/12/2012  2015        76
## 134                Fruit Ninja Game      Free   4/21/2010  2015       148
## 135                Angry Birds Game      Free   12/11/2009 2015       627
## 136             Subway Surfers Game      Free   5/24/2012  2015       303
## 137 Despicable Me: Minion Rush Game      Free   6/10/2013  2015       128
## 138             Clash of Clans Game      Free   8/2/2012   2015       345
## 139                 Temple Run Game      Free   8/4/2011   2015       378
## 140            Angry Birds Rio Game      Free   3/22/2011  2015       324
## 141               Temple Run 2 Game      Free   1/16/2013  2015       503
## 142         Words With Friends Game      Free   9-Jul      2015        86
##          Source
## 1   Google Play
## 2   Google Play
## 3   Google Play
## 4   Google Play
## 5   Google Play
## 6   Google Play
## 7   Google Play
## 8   Google Play
## 9   Google Play
## 10  Google Play
## 13  Google Play
## 14  Google Play
## 15  Google Play
## 16  Google Play
## 17  Google Play
## 18  Google Play
## 19  Google Play
## 20  Google Play
## 21  Google Play
## 22  Google Play
## 25  Google Play
## 26  Google Play
## 27  Google Play
## 28  Google Play
## 29  Google Play
## 30  Google Play
## 31  Google Play
## 32  Google Play
## 33  Google Play
## 34  Google Play
## 37  Google Play
## 38  Google Play
## 39  Google Play
## 40  Google Play
## 41  Google Play
## 42  Google Play
## 43  Google Play
## 44  Google Play
## 45  Google Play
## 46  Google Play
## 49  Google Play
## 50  Google Play
## 51  Google Play
## 52  Google Play
## 53  Google Play
## 54  Google Play
## 55  Google Play
## 56  Google Play
## 57  Google Play
## 58  Google Play
## 61  Google Play
## 62  Google Play
## 63  Google Play
## 64  Google Play
## 65  Google Play
## 66  Google Play
## 67  Google Play
## 68  Google Play
## 69  Google Play
## 70  Google Play
## 73  Apple Store
## 74  Apple Store
## 75  Apple Store
## 76  Apple Store
## 77  Apple Store
## 78  Apple Store
## 79  Apple Store
## 80  Apple Store
## 81  Apple Store
## 82  Apple Store
## 85  Apple Store
## 86  Apple Store
## 87  Apple Store
## 88  Apple Store
## 89  Apple Store
## 90  Apple Store
## 91  Apple Store
## 92  Apple Store
## 93  Apple Store
## 94  Apple Store
## 97  Apple Store
## 98  Apple Store
## 99  Apple Store
## 100 Apple Store
## 101 Apple Store
## 102 Apple Store
## 103 Apple Store
## 104 Apple Store
## 105 Apple Store
## 106 Apple Store
## 109 Apple Store
## 110 Apple Store
## 111 Apple Store
## 112 Apple Store
## 113 Apple Store
## 114 Apple Store
## 115 Apple Store
## 116 Apple Store
## 117 Apple Store
## 118 Apple Store
## 121 Apple Store
## 122 Apple Store
## 123 Apple Store
## 124 Apple Store
## 125 Apple Store
## 126 Apple Store
## 127 Apple Store
## 128 Apple Store
## 129 Apple Store
## 130 Apple Store
## 133 Apple Store
## 134 Apple Store
## 135 Apple Store
## 136 Apple Store
## 137 Apple Store
## 138 Apple Store
## 139 Apple Store
## 140 Apple Store
## 141 Apple Store
## 142 Apple Store
freeapps1 <- freeapps %>%
  group_by(App.Name) %>%
  summarise(Avg.Downloads = mean(Downloads, na.rm = TRUE)) 
freeapps1
## Source: local data frame [10 x 2]
## 
##                      App.Name Avg.Downloads
##                        (fctr)         (dbl)
## 1                 Angry Birds     378.25000
## 2             Angry Birds Rio     307.50000
## 3            Candy Crush Saga      48.87500
## 4              Clash of Clans     161.28571
## 5  Despicable Me: Minion Rush      96.33333
## 6                 Fruit Ninja      77.08333
## 7              Subway Surfers     171.25000
## 8                  Temple Run     235.11111
## 9                Temple Run 2     400.83333
## 10         Words With Friends     115.50000
#  Conclusion:  The Temple Run 2 app had the most average downloads among the free apps.
#  I followed the same procedure for the paid apps.

paidapps <- subset(apps1, Paid.Free == "Paid")
paidapps
##                      App.Name Type Paid.Free Release.Date Year Downloads
## 11  Minecraft: Pocket Edition Game      Paid   11/7/2011  2010        NA
## 12                   NBA 2K16 Game      Paid   10/14/2015 2010        NA
## 23  Minecraft: Pocket Edition Game      Paid   11/7/2011  2011         8
## 24                   NBA 2K16 Game      Paid   10/14/2015 2011        NA
## 35  Minecraft: Pocket Edition Game      Paid   11/7/2011  2012       154
## 36                   NBA 2K16 Game      Paid   10/14/2015 2012        NA
## 47  Minecraft: Pocket Edition Game      Paid   11/7/2011  2013       285
## 48                   NBA 2K16 Game      Paid   10/14/2015 2013        NA
## 59  Minecraft: Pocket Edition Game      Paid   11/7/2011  2014       369
## 60                   NBA 2K16 Game      Paid   10/14/2015 2014        NA
## 71  Minecraft: Pocket Edition Game      Paid   11/7/2011  2015       352
## 72                   NBA 2K16 Game      Paid   10/14/2015 2015       345
## 83  Minecraft: Pocket Edition Game      Paid   11/7/2011  2010        NA
## 84                   NBA 2K16 Game      Paid   10/14/2015 2010        NA
## 95  Minecraft: Pocket Edition Game      Paid   11/7/2011  2011         4
## 96                   NBA 2K16 Game      Paid   10/14/2015 2011        NA
## 107 Minecraft: Pocket Edition Game      Paid   11/7/2011  2012       120
## 108                  NBA 2K16 Game      Paid   10/14/2015 2012        NA
## 119 Minecraft: Pocket Edition Game      Paid   11/7/2011  2013       240
## 120                  NBA 2K16 Game      Paid   10/14/2015 2013        NA
## 131 Minecraft: Pocket Edition Game      Paid   11/7/2011  2014       320
## 132                  NBA 2K16 Game      Paid   10/14/2015 2014        NA
## 143 Minecraft: Pocket Edition Game      Paid   11/7/2011  2015       340
## 144                  NBA 2K16 Game      Paid   10/14/2015 2015       245
##          Source
## 11  Google Play
## 12  Google Play
## 23  Google Play
## 24  Google Play
## 35  Google Play
## 36  Google Play
## 47  Google Play
## 48  Google Play
## 59  Google Play
## 60  Google Play
## 71  Google Play
## 72  Google Play
## 83  Apple Store
## 84  Apple Store
## 95  Apple Store
## 96  Apple Store
## 107 Apple Store
## 108 Apple Store
## 119 Apple Store
## 120 Apple Store
## 131 Apple Store
## 132 Apple Store
## 143 Apple Store
## 144 Apple Store
paidapps1 <- paidapps %>%
  group_by(App.Name) %>%
  summarise(Avg.Downloads = mean(Downloads, na.rm = TRUE)) 
paidapps1
## Source: local data frame [2 x 2]
## 
##                    App.Name Avg.Downloads
##                      (fctr)         (dbl)
## 1 Minecraft: Pocket Edition         219.2
## 2                  NBA 2K16         295.0
#  Conclusion:  The NBA 2K16 app had the most average downloads among the paid apps.