This function will return a list object output. The function itself
requires that a time series tibble/data.frame get passed to it, along with
the .date_col
, the .value_col
and a period of data. It uses the underlying
function timetk::tk_tsfeatures()
and takes the output of that and performs
a clustering analysis using the K-Means
algorithm.
The function has a parameter of .features
which can take any of the features
listed in the tsfeatures
package by Rob Hyndman. You can also create custom
functions in the .GlobalEnviron
and it will take them as quoted arguments.
So you can make a function as follows
my_mean <- function(x){return(mean(x, na.rm = TRUE))}
You can then call this by using .features = c("my_mean")
.
The output of this function includes the following:
Data Section
Plots