smooth: smooth

Description Usage Arguments Value Examples

View source: R/smooth.R

Description

Function to smooth data across different time windows length and position (trailing or surrounding)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
smooth(
  data = NULL,
  window_length = 5,
  window_type = "trail",
  save = TRUE,
  diagnostics = FALSE,
  diagnostics_n = 20,
  diagnostics_col = NULL,
  filename = NULL,
  folder = NULL,
  output_type = "wide"
)

Arguments

data

Default = NULL. Input data as R dataframe or CSV

window_length

Default = 5. Length of smoothing window to use in units of data time period.

window_type

Default = "trail". Can be "trail" or "surround" where "trail" uses time periods up to the value being smoothed and "surround" uses time period before and after each value being smoothed.

save

Default = TRUE. Whether data should be printed as a csv or not.

diagnostics

Default = FALSE. Whether diagnostic figures should be produced.

diagnostics_n

Default = 20. Number of sub-plots in each diagnostic figure.

diagnostics_col

Default = NULL. Which column to plot diagnostics for.

filename

Default = NULL

folder

Default = NULL

output_type

Default = "wide". Output dimensions long or wide.

Value

Returns a dataframe (and csv file if save = TRUE)

Examples

1
library(rpackageutils)

JGCRI/rpackageutils documentation built on Dec. 13, 2021, 10:05 p.m.