第 5 章 echarter

echarter 可以根据数据类型,快速的绘制echarts.

目前支持的数据类型有: data.frame, numeric, histogram, character, factor, ts, mts, xts (and OHLC), forecast, acf, dist.

5.1 Data Frames

library(tidyverse)
library(echarter)
dat <- data.frame(
 saleNum = round(runif(21, 20, 100), 0),
 fruit = c(rep("Apple", 7), rep("Pear", 7), rep("Banana", 7)),
 weekDay = c(rep(c('Mon','Tues','Wed','Thurs','Fri','Sat','Sun'),3)),
 price = round(runif(21, 10, 20), 0),
 stringsAsFactors = FALSE)

echarter(
  dat, type = "line", mapping = ecaes(x = weekDay, y = saleNum, group = fruit)) %>% 
  ec_title(text = "Fruit Salse") %>% 
  ec_xAxis(nameLocation = "center", nameGap = 30) %>% 
  ec_yAxis(nameLocation = "center", nameGap = 30)

5.2 Numeric & Histograms

5.3 Densities

5.4 Character & Factor

5.5 Time Series

5.6 Seasonal Decomposition of Time Series by Loess

5.7 Forecast package

5.8 igraph

5.9 xts from quantmod package

5.10 xts ohlc objects

5.11 Autocovariance & Autocorrelation

5.12 Multivariate Time series

5.13 Survival Models

5.14 Principal Components

5.15 Matrix

5.16 Distance matrix

5.17 Correlation matrix