chartist: Draw a Chartist.js chart

Description Usage Arguments See Also Examples

Description

Draw a Chartist.js chart. chartist is NSE version and chartist_ is SE version. You can specify column the same way as dplyr's select does (The trick is very simple; actually select is used inside).

NSE Version of function to create chartist plot

Usage

1
2
3
chartist_(data, x_labels, select_cols)

chartist(data, x_label_colname, ...)

Arguments

data

data.frame containing x-axis label and data series

x_labels

x-axis labels, or the column name which contains x-axis labels

select_cols

column name(s) of data

x_label_colname

x-axis labels, or the column name which contains x-axis labels

...

column name(s) of data. If not specified, use all column except for label_colname

See Also

http://gionkunz.github.io/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
set.seed(324)
data <- data.frame(
  day = paste0("day", 1:10),
  A   = runif(10, 0, 10),
  B   = runif(10, 0, 10),
  C   = runif(10, 0, 10)
)

# NSE version
chartist(data, day)

# These are the same
chartist(data, day, A, B)
chartist(data, day, A:B)
chartist(data, day, -C)

# SE version
chartist_(data, "day", c("A", "B"))

# SE version is usuful when you use variables
lab <- "day"
col <- c("A", "B")
chartist_(data, lab, col)

# With using SE version, labels can be specified directly
chartist_(data, rep(c("Odd", "Even"), 5), "A")

yutannihilation/chartist documentation built on May 4, 2019, 7:45 p.m.