ptt_plot_add_secondary_traces: Add secondary traces of existing traces with reduced...

View source: R/ptt_plot_base.R

ptt_plot_add_secondary_tracesR Documentation

Add secondary traces of existing traces with reduced linewidth to an existing ptt_plot.

Description

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)", dateformat = "%Y-%m-&d")".

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

pttry/pttrobo documentation built on March 5, 2025, 6:36 p.m.