View source: R/ptt_plot_base.R
ptt_plot_add_secondary_traces | R Documentation |
Outputs a plotly object.
ptt_plot_add_secondary_traces(
p,
secondary_data,
relates_to,
grouping,
hovertext,
showlegend = TRUE
)
p |
Plotly object created with ptt_plot to add prediction traces to. |
secondary_data |
Tibble with secondary variables of one grouping in the parent ptt_plot object. |
relates_to |
The name of the grouping that the secondary data relates. |
grouping |
Tibble column used for grouping in plot, should be labeled the same as data used for parent ptt_plot. |
hovertext |
Uses parent ptt_plot specification if undefined. A list describing hovertext items "list(rounding = 1, unit = "%", extra = "(ennuste)", dateformat = "%Y-%m-&d")". |
showlegend |
A locigal to show legend for secondary trace. |
plotly object
d2 <- d |> dplyr::filter(tiedot == "BKT") |> dplyr::mutate(value = statfitools::trend_series(value, time)) |> dplyr::mutate(tiedot = "esimerkkisarja")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.