Description Usage Arguments Value
Given a numeric vector, it calculates a rolling median and then from each element, it subtracts the local median. The window for the median is centered on the element, so if the size is 5, it takes the element itself and the elements up to ±2 positions from it. If the size is even, it's rounded down (e.g. window_size = 6 is the same as window_size = 5).
1 | detrend(x, window_size = 5)
|
x |
A numeric vector. |
window_size |
A length for the rolling window to calculate the median. |
A numeric vector, de-trended.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.