太空發射資料導論

R 的 plotly 互動式資料視覺化:中級

Adam Loy

Statistician, Carleton College

發射資料集

R 的 plotly 互動式資料視覺化:中級

發射資料集

dplyr::glimpse(launches)
Rows: 5,726
Columns: 11
$ tag         <chr> "1967-065", "1967-080", "1967-096", "1968-042", …
$ JD          <dbl> 2439671, 2439726, 2439775, 2440000, 2440153, 244…
$ launch_date <date> 1967-06-29, 1967-08-23, 1967-10-11, 1968-05-23,…
$ launch_year <dbl> 1967, 1967, 1967, 1968, 1968, 1969, 1970, 1970, …
$ type        <chr> "Thor Burner 2", "Thor Burner 2", "Thor Burner 2"…
$ variant     <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
$ mission     <chr> "Secor Type II S/N 10", "DAPP 3419", "DAPP 4417"…
$ agency      <chr> "US", "US", "US", "US", "US", "US", "US", "US", …
$ state_code  <chr> "US", "US", "US", "US", "US", "US", "US", "US", …
$ category    <chr> "O", "O", "O", "O", "O", "O", "O", "O", "O", "O"…
$ agency_type <chr> "state", "state", "state", "state", "state", "state"…
R 的 plotly 互動式資料視覺化:中級

變數

變數 定義
launch_year 發射年份
agency 發射單位
state_code 發射單位所屬國家/地區代碼
category 成功(O)或失敗(F)
agency_type 機構類型
variable definition
tag Harvard or COSPAR id of launch
JD Julian Date of launch
launch_date date of launch
type type of launch vehicle
variant variant of launch vehicle
mission mission name
R 的 plotly 互動式資料視覺化:中級

探索太空競賽

space_race_states.gif

R 的 plotly 互動式資料視覺化:中級

R 套件下載量

ch4_1_shareddata_review.gif

R 的 plotly 互動式資料視覺化:中級

CRAN 下載記錄

dplyr::glimpse(monthly_logs)
Rows: 171
Columns: 4
$ package   <chr> "ggvis", "ggvis", "ggvis", "ggvis", "ggvis", "ggvis",…
$ date      <date> 2014-06-30, 2014-07-31, 2014-08-31, 2014-09-30, 2014…
$ dec_date  <dbl> 2014.49, 2014.58, 2014.66, 2014.75, 2014.83, 2014.91,…
$ downloads <dbl> 1344, 2120, 2035, 1702, 3590, 2899, 2427, 2227, 2708,…
R 的 plotly 互動式資料視覺化:中級

分組刷選

shared_logs <- monthly_logs %>% SharedData$new(key = ~package)

shared_logs %>% plot_ly(x = ~dec_date, y = ~downloads, color = ~package) %>% add_lines() %>% highlight()
R 的 plotly 互動式資料視覺化:中級

一起來練習吧!

R 的 plotly 互動式資料視覺化:中級

Preparing Video For Download...