stats_plotly: Interactively plot stats chart by plotly

Description Usage Arguments Value Functions See Also

Description

Plot statistic chart interactively by plotly package, an (MIT licensed) web-based interactive charting library.

Usage

 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
freqbar_plotly(
  ds_vars,
  var_name,
  ds_vars_compare = NULL,
  plot_method = c("plot_ly", "ggplot"),
  source_id = paste0("freqbar_", var_name)
)

boxplot_plotly(
  ds_vars,
  var_name,
  ds_vars_compare = NULL,
  plot_method = c("plot_ly", "ggplot"),
  source_id = paste0("boxplot_", var_name)
)

hist_plotly(
  ds_vars,
  var_name,
  ds_vars_compare = NULL,
  plot_method = c("plot_ly", "ggplot"),
  source_id = paste0("hist_", var_name)
)

density_plotly(
  ds_vars,
  var_name,
  ds_vars_compare = NULL,
  plot_method = c("plot_ly", "ggplot"),
  source_id = paste0("density_", var_name)
)

qqplot_plotly(
  ds_vars,
  var_name,
  ds_vars_compare = NULL,
  plot_method = c("plot_ly", "ggplot"),
  source_id = paste0("qqplot_", var_name)
)

scatter_plotly(
  ds_vars,
  x_var_name,
  y_var_name,
  ds_vars_compare = NULL,
  plot_method = c("plot_ly", "ggplot"),
  source_id = paste0("scatter_", x_var_name, "_", y_var_name)
)

combochart_plotly(
  ds_vars,
  continuous_var_name,
  discrete_var_name,
  ds_vars_compare = NULL,
  top_levels = 5,
  geom_type = c("boxplot", "bar_mean", "bar_median"),
  plot_method = c("plot_ly", "ggplot"),
  source_id = paste0("scatter_", continuous_var_name, "_", discrete_var_name)
)

Arguments

ds_vars

A data.frame of data for plotting.

var_name

A character of variable name.

ds_vars_compare

A data.frame of data for plotting reference.

plot_method

A character of method to plotting, "plot_ly" means to use plotly function, "ggplot" means to use [ggplot2::ggplot()] + plotly::ggplotly().

source_id

a character string of length 1. Match the value of this string with the source argument in plotly::event_data() to retrieve the event data corresponding to a specific plot (shiny apps can have multiple plots).

x_var_name

A character of name of variable x.

y_var_name

A character of name of variable y.

continuous_var_name

A character of name of continuous variable.

discrete_var_name

A character of name of discrete variable.

top_levels

A integer of top levels to display, default 5 means levels with top 5 most frequencies will be dispaly.

geom_type

A character of geom type to plot continuous variable, e.g "boxplot", "bar_mean", "bar_median", default boxplot means use boxplot.

Value

A plotly object.

Functions

See Also

Other stats_plotly: gg_scale_compare()


chriszheng2016/zstexplorer documentation built on June 13, 2021, 9:47 a.m.