-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample_effect_plotly.R
39 lines (39 loc) · 1.53 KB
/
example_effect_plotly.R
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
#' @examples
#' library(plotly)
#' plot_ly(z, x = ~x, y = ~estimate) |>
#' add_fan(sd = ~sd, text = ~display, hoverinfo = "text") |>
#' add_classification(lcl = ~lcl, ucl = ~ucl, threshold = 1) |>
#' layout(
#' shapes = reference_shape(threshold = 1),
#' annotations = reference_text(threshold = 1)
#' )
#' plot_ly(z, x = ~x, y = ~estimate) |>
#' add_fan(sd = ~sd, step = 0.1, text = ~display, hoverinfo = "text") |>
#' add_classification(
#' lcl = ~lcl, ucl = ~ucl, threshold = 1, detailed = FALSE
#' ) |>
#' layout(
#' shapes = reference_shape(threshold = 1, line = TRUE),
#' annotations = reference_text(threshold = 1)
#' )
#' plot_ly(z, x = ~x, y = ~estimate) |>
#' add_fan(sd = ~sd, step = 0.2, text = ~display, hoverinfo = "text") |>
#' add_classification(
#' lcl = ~lcl, ucl = ~ucl, threshold = 1, signed = FALSE
#' ) |>
#' layout(shapes = reference_shape(threshold = 1))
#' plot_ly(z, x = ~x, y = ~estimate) |>
#' add_fan(sd = ~sd, step = 0.3, text = ~display, hoverinfo = "text") |>
#' add_classification(
#' lcl = ~lcl, ucl = ~ucl, threshold = 1, detailed = FALSE, signed = FALSE
#' ) |>
#' layout(shapes = reference_shape(threshold = 1, line = TRUE))
#'
#' # trend
#' plot_ly(data = trend, x = ~year, y = ~index) |>
#' add_fan(sd = ~sd, text = ~display, hoverinfo = "text") |>
#' add_classification(sd = ~sd, threshold = th) |>
#' layout(
#' shapes = reference_shape(threshold = th, reference = ref),
#' annotations = reference_text(threshold = th, reference = ref)
#' )