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', 'weighted', 'ignore_blocks', and 'lock_step'.
Arguments
- df
(required, data frame) Output of
distantia()
ordistantia_aggregate()
. Default: NULL
See also
Other internal:
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 weighted ignore_blocks lock_step x y psi
#> 4 euclidean TRUE TRUE FALSE TRUE Germany Spain 1.3962157
#> 5 euclidean TRUE TRUE FALSE TRUE Germany Sweden 0.8364652
#> 6 euclidean TRUE TRUE FALSE TRUE Spain Sweden 1.5703931
#> group
#> 4 1
#> 5 1
#> 6 1
#>
#> $`2`
#> distance diagonal weighted ignore_blocks lock_step x y psi
#> 10 manhattan TRUE TRUE FALSE TRUE Germany Spain 1.3737381
#> 11 manhattan TRUE TRUE FALSE TRUE Germany Sweden 0.8271986
#> 12 manhattan TRUE TRUE FALSE TRUE Spain Sweden 1.5755002
#> group
#> 10 2
#> 11 2
#> 12 2
#>
#> $`3`
#> distance diagonal weighted ignore_blocks lock_step x y psi
#> 1 euclidean TRUE TRUE FALSE FALSE Germany Spain 1.0360268
#> 2 euclidean TRUE TRUE FALSE FALSE Germany Sweden 0.7285701
#> 3 euclidean TRUE TRUE FALSE FALSE Spain Sweden 1.0237508
#> group
#> 1 3
#> 2 3
#> 3 3
#>
#> $`4`
#> distance diagonal weighted ignore_blocks lock_step x y psi
#> 7 manhattan TRUE TRUE FALSE FALSE Germany Spain 1.134012
#> 8 manhattan TRUE TRUE FALSE FALSE Germany Sweden 0.761250
#> 9 manhattan TRUE TRUE FALSE FALSE Spain Sweden 1.166331
#> group
#> 7 4
#> 8 4
#> 9 4
#>
#class and length of the output
class(df_split)
#> [1] "list"
length(df_split)
#> [1] 4