Split Dissimilarity Analysis Data Frames by Combinations of Arguments
Source:R/utils_distantia_df_split.R
utils_distantia_df_split.Rd
Internal function to split a distantia data frame by groups of the arguments 'distance', 'diagonal', and 'lock_step'.
Arguments
- df
(required, data frame) Output of
distantia()
ordistantia_aggregate()
. Default: NULL
See also
Other internal:
utils_boxplot_common()
,
utils_check_args_distantia()
,
utils_check_args_matrix()
,
utils_check_args_path()
,
utils_check_args_tsl()
,
utils_check_args_zoo()
,
utils_check_distance_args()
,
utils_check_list_class()
,
utils_clean_names()
,
utils_digits()
,
utils_distantia_df_to_matrix()
,
utils_prepare_df()
,
utils_prepare_matrix()
,
utils_prepare_matrix_list()
,
utils_prepare_time()
,
utils_prepare_vector_list()
,
utils_prepare_zoo_list()
,
utils_tsl_pairs()
Examples
#three time series
#climate and ndvi in Fagus sylvatica stands in Spain, Germany, and Sweden
tsl <- tsl_initialize(
x = fagus_dynamics,
name_column = "name",
time_column = "time"
)
#dissimilarity analysis with four combinations of parameters
df <- distantia(
tsl = tsl,
distance = c(
"euclidean",
"manhattan"
),
lock_step = c(
TRUE,
FALSE
)
)
#split by combinations of parameters
df_split <- utils_distantia_df_split(
df = df
)
#print output
df_split
#> $`1`
#> distance diagonal lock_step x y bandwidth psi group
#> 1 euclidean TRUE FALSE Germany Sweden 1 0.7285701 1
#> 2 euclidean TRUE FALSE Germany Spain 1 1.0360268 1
#> 3 euclidean TRUE FALSE Spain Sweden 1 1.0237508 1
#>
#> $`2`
#> distance diagonal lock_step x y bandwidth psi group
#> 7 manhattan TRUE FALSE Germany Spain 1 1.134012 2
#> 8 manhattan TRUE FALSE Spain Sweden 1 1.166331 2
#> 9 manhattan TRUE FALSE Germany Sweden 1 0.761250 2
#>
#> $`3`
#> distance diagonal lock_step x y bandwidth psi group
#> 10 manhattan TRUE TRUE Germany Sweden 1 0.8271986 3
#> 11 manhattan TRUE TRUE Spain Sweden 1 1.5755002 3
#> 12 manhattan TRUE TRUE Germany Spain 1 1.3737381 3
#>
#> $`4`
#> distance diagonal lock_step x y bandwidth psi group
#> 4 euclidean TRUE TRUE Germany Spain 1 1.3962157 4
#> 5 euclidean TRUE TRUE Spain Sweden 1 1.5703931 4
#> 6 euclidean TRUE TRUE Germany Sweden 1 0.8364652 4
#>
#class and length of the output
class(df_split)
#> [1] "list"
length(df_split)
#> [1] 4