Skip to contents

Outputs a plotly object.

Usage

ptt_plot_add_secondary_traces(
  p,
  secondary_data,
  relates_to,
  grouping,
  hovertext,
  showlegend = TRUE
)

Arguments

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)")".

showlegend

A locigal to show legend for secondary trace.

Value

plotly object

Examples

d2 <- d |> dplyr::filter(tiedot == "BKT") |> dplyr::mutate(value = statfitools::trend_series(value, time)) |> dplyr::mutate(tiedot = "esimerkkisarja")
#> Error in dplyr::filter(d, tiedot == "BKT"): object 'd' not found