| d_detrend | R Documentation |
Removes a polynomial trend of the specified degree along the chosen dimension.
d_detrend(x, dim = c("rows", "cols"), axis = NULL, degree = 1L)
x |
A |
dim |
Dimension along which to fit the trend. |
axis |
Integer axis for N-d arrays (alternative to |
degree |
Polynomial degree (default 1). |
A delarr with the detrend operation queued.
# Create matrix with linear trend in rows
mat <- matrix(1:12 + rep(1:4, each = 3), nrow = 3, ncol = 4)
darr <- delarr(mat)
# Remove linear trend along rows
detrended <- darr |> d_detrend(dim = "rows", degree = 1L) |> collect()
detrended
# Remove quadratic trend
quad_detrend <- darr |> d_detrend(dim = "rows", degree = 2L) |> collect()
quad_detrend
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.