| ggcptplot | R Documentation |
The plot for changepoints detected by the changepoint package is a line plot for the raw data and the vertical lines representing each changepoint. The x-axis is the row number of the raw data in the original data vector. The plot inherits ggplot2, meaning users can add ggplot2 functions on top the changepoint plot for customization.
ggcptplot(
data,
change_in = "mean_var",
cp_method = "PELT",
...,
cptline_alpha = 1,
cptline_color = "blue",
cptline_type = "solid",
cptline_linewidth = 0.5,
cptline_size = lifecycle::deprecated(),
index = NULL,
show_points = NULL,
show_line = TRUE
)
data |
A numeric vector. |
change_in |
Choice of |
cp_method |
A wide range of choices (i.e., |
... |
Extra arguments for each |
cptline_alpha |
The value of alpha for the vertical changepoint line(s), default is 1, meaning no transparency. |
cptline_color |
The color for the vertical changepoint line(s), default
is |
cptline_type |
The linetype for the vertical changepoint line(s),
default is |
cptline_linewidth |
The linewidth for the vertical changepoint line(s),
default is |
cptline_size |
Deprecated. Use |
index |
Optional. A vector of x-axis labels (e.g. dates) of the same
length as |
show_points |
Logical. Whether to draw data points. Defaults to
|
show_line |
Logical. Whether to draw the line. Defaults to |
A line plot with data points along with the vertical lines representing changepoints.
Other plotting:
ggcpt_compare_table(),
ggcpt_eval(),
ggcpt_interactive(),
ggecpplot()
ggcptplot(c(rnorm(100,0,1),rnorm(100,0,10)))
ggcptplot(c(rnorm(100,0,1),rnorm(100,10,1)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.