moving_filter_plot_f: Moving (weighted) average filter plot (filtered)

View source: R/moving_filter_plot_f.R

moving_filter_plot_fR Documentation

Moving (weighted) average filter plot (filtered)

Description

Plots the filtered results of a moving (weighted) average filter routine.

Usage

moving_filter_plot_f(
  x,
  xlab = "X",
  ylab = "Data",
  filterlab = "Filter & data",
  plotk = "all"
)

Arguments

x

The result of using the moving_avg_filter() or moving_wt_filter() functions

xlab

The label for the x-axis

ylab

The label for the y-axis

filterlab

The label for the legend

plotk

A string for choosing what to plot (Default is "all")

Value

ggplot and plotly objects with the filtered data and original data

Examples

data(nautilus)
k = c(3, 5, 7, 9)
filt = moving_avg_filter(nautilus$x, nautilus$y, k)
moving_filter_plot_f(filt)
moving_filter_plot_f(filt, plotk = c("y", "k_9")) # plots data and filter of window 9
moving_filter_plot_f(filt, plotk = c("k_3", "k_9")) # plots filters of window 3 and 9


maxgav13/GMisc documentation built on June 12, 2022, 3:48 a.m.