Detrend | R Documentation |
Detrends a time series using either a linear fit covering the entire dataset or moving average trend correction with a user-specified window width.
Detrend(Data, Method = "window", Window_Width = 89,
End_Length = 1826, PLOT = FALSE, x_lab = "Data", y_lab = "Data")
Data |
Data frame containing two columns. In column:
|
Method |
Character vector of length one specifying approach used to detrend the data. Options are moving average |
Window_Width |
Numeric vector of length one specifying length of the moving average window. Default is |
End_Length |
Numeric vector of length one specifying number of observations at the end of the time series used to calculate the present day average. Default is |
PLOT |
Logical; whether to plot original and detrended series. Default is |
x_lab |
Character vector of length one specifying x-axis label. Default is |
y_lab |
Character vector of length one specifying y-axis label. Default is |
Numeric vector of the detrended time series.
#Detrending ocean-side water level at site S22 using a 3 month moving average window and the last
#five years of observations to calculate the present day average.
Detrend(S22_T_MAX_Daily_Completed_Detrend,Method = "window",Window_Width= 89,
End_Length = 1826, PLOT=FALSE,x_lab="Data",y_lab="Data")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.