研究問題與動機描述

1.電力產生VS CO2平均排放量
2.所得VS獎牌

讀取套件及資料

library(readr)
athlete<-read_csv("../asset/athlete_all.csv")
## Warning: Missing column names filled in: 'X1' [1]
## Parsed with column specification:
## cols(
##   .default = col_double(),
##   country = col_character(),
##   Name = col_character(),
##   Sex = col_character(),
##   NOC = col_character(),
##   Games = col_character(),
##   Season = col_character(),
##   City = col_character(),
##   Sport = col_character(),
##   Event = col_character(),
##   Medal = col_character()
## )
## See spec(...) for full column specifications.
## Warning: 42 parsing failures.
##  row           col               expected actual                       file
## 1166 female_school no trailing characters      r '../asset/athlete_all.csv'
## 1167 female_school no trailing characters      r '../asset/athlete_all.csv'
## 1168 female_school no trailing characters      r '../asset/athlete_all.csv'
## 1169 female_school no trailing characters      r '../asset/athlete_all.csv'
## 1170 female_school no trailing characters      r '../asset/athlete_all.csv'
## .... ............. ...................... ...... ..........................
## See problems(...) for more details.
pacman::p_load(devtools,dplyr, ggplot2, readr, plotly, googleVis,ggthemes,d3heatmap,magrittr)

資料探索(敘述性統計)

#summary(athlete)
#table(athlete$country,athlete$Medal)
#table(athlete$Sport,athlete$Medal) 

資料處理(dplyr)

t=athlete %>% select(Height,Name,country,Sport)%>%
  arrange(desc(Height))
head(t,100)
## # A tibble: 100 x 4
##    Height Name                   country       Sport     
##     <dbl> <chr>                  <chr>         <chr>     
##  1    226 Yao Ming               China         Basketball
##  2    226 Yao Ming               China         Basketball
##  3    226 Yao Ming               China         Basketball
##  4    223 Arvydas Romas Sabonis  Lithuania     Basketball
##  5    223 Arvydas Romas Sabonis  Lithuania     Basketball
##  6    223 Arvydas Romas Sabonis  Soviet Union  Basketball
##  7    223 Tommy Loren Burleson   United States Basketball
##  8    221 Zhang Zhaoxu           China         Basketball
##  9    221 Gunther Behnke         Germany       Basketball
## 10    221 Roberto Dueas Hernndez Spain         Basketball
## # ... with 90 more rows

資料視覺化

a1<-ggplot(athlete,aes(income_GDP))+geom_histogram(fill="#007799")+theme_economist()+scale_color_economist()
ggplotly(a1)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## Warning: Removed 45550 rows containing non-finite values (stat_bin).
動態泡泡圖
library(googleVis)
#op = options(gvis.plot.tag='chart')
a1<-athlete %>% na.omit() %>% group_by(country,year,ce_rate,electricity,female_school,food_suppiy,health_expense,income_GDP,baby_pw,co2_em,child_mortality,inflation,unemployment_15,bc_w_death,democracy_score )  %>% summarise(Age=mean(Age),Height=mean(Height),Weight=mean(Weight))
gvisMotionChart(a1, "country", "year") %>% plot
## starting httpd help server ... done

結論與洞察

從一開始甚麼都不會做,到一直詢問同學和助教,慢慢完成一點作品。 經過這次分組討論報告,雖然是經由複製貼上很簡單的方式,拼湊出來的作品,但也在其中學到很多。謝謝中山大學辦這個營隊,讓我們收穫滿滿,謝謝大家。