各州間的物流績效

載入套件與資料

平均物流時間與送貨延遲比率



地圖與地理統計資訊

🌻 sf這個圖資套件可以很方便的讀進地圖,並將圖資與其他資料欄位整合,一起放在同一個資料框裡面。

Loading required package: brazilmaps

🌻 各州中心點與距離矩陣

🌻 直接用plot()指令,就可以把資料欄位畫在地圖上面

🌻 濾掉極端值(DF),讓色階可以呈現較多資訊



進階的互動圖台套件

🌻 用ggplotplotly可以畫得更好,但是所有的欄位都要用同一個色階

🌻 用tmap可以結合互動地圖,請參考tmap: get started!



在地圖上畫出供應鏈相關欄位

將供應鏈相關資料匯整到stCodedf1,df2

# A tibble: 27 x 6
   stCode t_freight a_freight t_price a_price r_freight
 * <chr>      <dbl>     <dbl>   <dbl>   <dbl>     <dbl>
 1 AC         3687.      40.1  15983.    174.      18.7
 2 AL        15915.      35.8  80315.    181.      16.5
 3 AM         5479.      33.2  22357.    135.      19.7
 4 AP         2788.      34.0  13474.    164.      17.2
 5 BA       100157.      26.4 511350.    135.      16.4
 6 CE        48352.      32.7 227255.    154.      17.5
 7 DF        50626.      21.0 302604.    126.      14.3
 8 ES        49765.      22.1 275037.    122.      15.3
 9 GO        53115.      22.8 294592.    126.      15.3
10 MA        31524.      38.3 119648.    145.      20.8
# ... with 17 more rows
# A tibble: 27 x 7
   stCode    t3 t.total t.estimate t.delay t.limit r.delay
 * <chr>  <dbl>   <dbl>      <dbl>   <dbl>   <dbl>   <dbl>
 1 AC      17.3    20.7       41.1   -20.3     6.9    3.3 
 2 AL      20.8    24.5       32.5    -8.1     6.8   24.1 
 3 AM      23.5    26.4       45.6   -19.2     6.7    4.29
 4 AP      24.6    28.2       45.8   -17.8     7.3    4.94
 5 BA      15.9    19.2       29.5   -10.3     6.7   13.7 
 6 CE      17.6    21         31.3   -10.4     6.6   15.3 
 7 DF       9.7    13         24.5   -11.5     7      7.43
 8 ES      12.2    15.6       25.6    -9.9     6.7   12.2 
 9 GO      12.3    15.4       27     -11.6     6.7    7.86
10 MA      17.8    21.7       30.9    -9.2     7.3   20.4 
# ... with 17 more rows

將資料併入圖資資料框:B2

Joining, by = "stCode"
Joining, by = "stCode"

🌻 在地圖上比較供應鏈相關欄位

🌻 使用ggplotplotly加強互動性和可比較性



策略規劃

資料分析的結果並不能直接變成策略,要做出實用的商業企劃,通常需要加上一些「假設」和「模擬」: