Data Visualization

Jolin Hsieh

2015年12月28日

Who am I ?

天氣風險公司 天氣分析師

  • 平常除了預報天氣
  • 剩下預報颱風
  • 一年前開始接觸R
  • 開始挖坑

What can I do ?

分析好資料之後,還可以做什麼?

Dynamic Graphics

All Open-source JavaScript libraries

  • leaflet
  • googleVis
  • dygraphs
  • plotly

leaflet

leaflet example

using map

library(leaflet)
library(magrittr)

leaflet() %>% 
  addTiles() %>% 
  addPopups(121.542587, 25.033686, "We are here!") %>%
  addProviderTiles("Stamen.Watercolor") %>% 
  addCircleMarkers(121.542587, 25.033686)

googleVis

  • Google Charts API
  • Flash player
  • Not uploaded to Google

googleVis example

library(googleVis)

df <- data.frame(country = c("US", "GB", "BR"), val1 = c(10, 13, 14), val2 = c(23, 
    12, 32))
Combo <- gvisComboChart(df, xvar = "country", yvar = c("val1", "val2"), options = list(seriesType = "bars", 
    series = "{1: {type:\"line\"}}"))
print(Combo, "chart")

dygraphs

dygraphs example

library(dygraphs)
library(magrittr)

lungDeaths <- cbind(ldeaths, mdeaths, fdeaths)
dygraph(lungDeaths, main = "Deaths from Lung Disease (UK)") %>%
  dyHighlight(highlightCircleSize = 5, 
              highlightSeriesBackgroundAlpha = 0.2,
              hideOnMouseOut = FALSE) %>% 
  dyRangeSelector()

Deaths from Lung Disease (UK)
ldeaths
mdeaths
fdeaths

plotly

Interactive graphics with D3. https://plot.ly/r/

  • easily translate ggplot2 to interactive graphics.
  • supports 20 chart types, including 3D plots, geographic maps…

plotly example

0.511.522.5305k10k15k20k
caratprice0.511.522.53carat

compare

推薦指數

  • leaflet
  • googleVis
  • dygraphs
  • plotly

Thank You for your attention