View source: R/momentum_to_wide.R
momentum_to_wide | R Documentation |
Transforms a data frame returned by momentum()
to wide format with the following columns:
most_similar
: name of the variable with the highest contribution to similarity (most negative value in the importance
column) for each pair of time series.
most_dissimilar
: name of the variable with the highest contribution to dissimilarity (most positive value in the importance
column) for each pair of time series.
importance__variable_name
: contribution to similarity (negative values) or dissimilarity (positive values) of the given variable.
psi_only_with__variable_name
: dissimilarity of the two time series when only using the given variable.
psi_without__variable_name
: dissimilarity of the two time series when removing the given variable.
momentum_to_wide(df = NULL, sep = "__")
df |
(required, data frame) Output of |
sep |
(required, character string) Separator between the name of the importance metric and the time series variable. Default: "__". |
data frame
Other momentum_support:
momentum_aggregate()
,
momentum_boxplot()
,
momentum_model_frame()
,
momentum_spatial()
,
momentum_stats()
tsl <- tsl_initialize(
x = distantia::albatross,
name_column = "name",
time_column = "time"
) |>
tsl_transform(
f = f_scale_global
)
#importance data frame
df <- momentum(
tsl = tsl
)
df
#to wide format
df_wide <- momentum_to_wide(
df = df
)
df_wide
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.