Package: distantia 2.0.0

distantia: A Toolset for Time Series Dissimilarity Analysis

Fast C++ implementation of Dynamic Time Warping for time series dissimilarity analysis, with applications in environmental monitoring and sensor data analysis, climate science, signal processing and pattern recognition, and financial data analysis. Built upon the ideas presented in Benito and Birks (2020) <doi:10.1111/ecog.04895>, provides tools for analyzing time series of varying lengths and structures, including irregular multivariate time series. Key features include individual variable contribution analysis, restricted permutation tests for statistical significance, and imputation of missing data via GAMs. Additionally, the package provides an ample set of tools to prepare and manage time series data.

Authors:Blas M. Benito [aut, cre, cph]

distantia_2.0.0.tar.gz
distantia_2.0.0.zip(r-4.5)distantia_2.0.0.zip(r-4.4)distantia_2.0.0.zip(r-4.3)
distantia_2.0.0.tgz(r-4.4-x86_64)distantia_2.0.0.tgz(r-4.4-arm64)distantia_2.0.0.tgz(r-4.3-x86_64)distantia_2.0.0.tgz(r-4.3-arm64)
distantia_2.0.0.tar.gz(r-4.5-noble)distantia_2.0.0.tar.gz(r-4.4-noble)
distantia_2.0.0.tgz(r-4.4-emscripten)distantia_2.0.0.tgz(r-4.3-emscripten)
distantia.pdf |distantia.html
distantia/json (API)
NEWS

# Install 'distantia' in R:
install.packages('distantia', repos = c('https://blasbenito.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/blasbenito/distantia/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

5.70 score 14 stars 15 scripts 566 downloads 155 exports 18 dependencies

Last updated 1 hours agofrom:95c4415e96. Checks:OK: 1 ERROR: 8. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 23 2024
R-4.5-win-x86_64ERRORNov 23 2024
R-4.5-linux-x86_64ERRORNov 23 2024
R-4.4-win-x86_64ERRORNov 23 2024
R-4.4-mac-x86_64ERRORNov 23 2024
R-4.4-mac-aarch64ERRORNov 23 2024
R-4.3-win-x86_64ERRORNov 23 2024
R-4.3-mac-x86_64ERRORNov 23 2024
R-4.3-mac-aarch64ERRORNov 23 2024

Exports:auto_distance_cppauto_sum_cppauto_sum_full_cppauto_sum_path_cppcost_matrix_diagonal_cppcost_matrix_diagonal_weighted_cppcost_matrix_orthogonal_cppcost_path_cppcost_path_diagonal_cppcost_path_orthogonal_cppcost_path_slotting_cppcost_path_sum_cppcost_path_trim_cppdistancedistance_canberra_cppdistance_chebyshev_cppdistance_chi_cppdistance_cosine_cppdistance_euclidean_cppdistance_hamming_cppdistance_hellinger_cppdistance_jaccard_cppdistance_lock_step_cppdistance_manhattan_cppdistance_matrix_cppdistance_russelrao_cppdistantiadistantia_aggregatedistantia_boxplotdistantia_cluster_hclustdistantia_cluster_kmeansdistantia_importancedistantia_matrixdistantia_plotdistantia_to_sff_centerf_detrend_differencef_detrend_linearf_hellingerf_listf_pcaf_percentagef_proportionf_rescalef_scalef_scale_globalf_slopef_smooth_windowf_trend_linearimportance_dynamic_time_warping_legacy_cppimportance_dynamic_time_warping_robust_cppimportance_lock_step_cppnull_psi_dynamic_time_warping_cppnull_psi_lock_step_cpppermute_free_by_row_cpppermute_free_cpppermute_restricted_by_row_cpppermute_restricted_cpppsi_auto_distancepsi_auto_sumpsi_cost_matrixpsi_cost_pathpsi_cost_path_ignore_blockspsi_cost_path_sumpsi_distance_lock_steppsi_distance_matrixpsi_dynamic_time_warping_cpppsi_equationpsi_equation_cpppsi_lock_step_cppsubset_matrix_by_rows_cpptsl_aggregatetsl_colnames_cleantsl_colnames_gettsl_colnames_settsl_count_NAtsl_diagnosetsl_handle_NAtsl_Inf_to_NAtsl_inittsl_initializetsl_names_cleantsl_names_gettsl_names_settsl_names_testtsl_NaN_to_NAtsl_ncoltsl_nrowtsl_plottsl_repairtsl_resampletsl_simulatetsl_splittsl_statstsl_subsettsl_timetsl_time_class_settsl_time_summarytsl_to_dftsl_transformutils_as_timeutils_block_sizeutils_check_args_distantiautils_check_args_matrixutils_check_args_pathutils_check_args_tslutils_check_args_zooutils_check_distance_argsutils_check_list_classutils_clean_namesutils_cluster_hclust_optimizerutils_cluster_kmeans_optimizerutils_cluster_silhouetteutils_coerce_time_classutils_color_breaksutils_color_continuous_defaultutils_color_discrete_defaultutils_digitsutils_distantia_df_splitutils_distantia_df_to_matrixutils_drop_geometryutils_global_scaling_paramsutils_importance_df_to_wideutils_is_timeutils_line_colorutils_line_guideutils_matrix_guideutils_matrix_plotutils_new_timeutils_new_time_typeutils_optimize_loessutils_optimize_splineutils_prepare_dfutils_prepare_matrixutils_prepare_matrix_listutils_prepare_timeutils_prepare_vector_listutils_prepare_zoo_listutils_rescale_vectorutils_time_keywordsutils_time_keywords_dictionaryutils_time_keywords_translateutils_time_unitsutils_tsl_pairszoo_aggregatezoo_name_cleanzoo_name_getzoo_name_setzoo_permutezoo_plotzoo_resamplezoo_simulatezoo_timezoo_to_tslzoo_vector_to_matrix

Dependencies:codetoolscpp11digestdoFutureforeachfuturefuture.applygenericsglobalsiteratorslatticelistenvlubridateparallellyprogressrRcpptimechangezoo

Readme and manuals

Help Manual

Help pageTopics
Flight Path Time Series of Albatrosses in The Pacificalbatross
(C++) Sum Distances Between Consecutive Samples in a Time Seriesauto_distance_cpp
(C++) Sum Distances Between Consecutive Samples in Two Time Seriesauto_sum_cpp
(C++) Sum Distances Between All Consecutive Samples in Two Time Seriesauto_sum_full_cpp
(C++) Sum Distances Between All Consecutive Samples in the Least Cost Path Between Two Time Seriesauto_sum_path_cpp
Coordinates of 100 Major Citiescities_coordinates
Long Term Monthly Temperature in 20 Major Citiescities_temperature
(C++) Compute Orthogonal and Diagonal Least Cost Matrix from a Distance Matrixcost_matrix_diagonal_cpp
(C++) Compute Orthogonal and Weighted Diagonal Least Cost Matrix from a Distance Matrixcost_matrix_diagonal_weighted_cpp
(C++) Compute Orthogonal Least Cost Matrix from a Distance Matrixcost_matrix_orthogonal_cpp
Find Least Cost Path within a Least Cost Matrixcost_path_cpp
(C++) Find Orthogonal And Diagonal Least Cost Path within a Least Cost Matrixcost_path_diagonal_cpp
(C++) Find Orthogonal Least Cost Path within a Least Cost Matrixcost_path_orthogonal_cpp
(C++) Least Cost Path for Sequence Slottingcost_path_slotting_cpp
(C++) Sum Distances in a Least Cost Pathcost_path_sum_cpp
(C++) Remove Blocks from a Least Cost Pathcost_path_trim_cpp
County Coordinates of the Covid Prevalence Datasetcovid_coordinates
Time Series of Covid Prevalence in California Countiescovid_prevalence
Distance Between Numeric Vectorsdistance
(C++) Canberra Distance Between Two Binary Vectorsdistance_canberra_cpp
(C++) Chebyshev Distance Between Two Vectorsdistance_chebyshev_cpp
(C++) Normalized Chi Distance Between Two Vectorsdistance_chi_cpp
(C++) Cosine Dissimilarity Between Two Vectorsdistance_cosine_cpp
(C++) Euclidean Distance Between Two Vectorsdistance_euclidean_cpp
(C++) Hamming Distance Between Two Binary Vectorsdistance_hamming_cpp
(C++) Hellinger Distance Between Two Vectorsdistance_hellinger_cpp
(C++) Jaccard Distance Between Two Binary Vectorsdistance_jaccard_cpp
(C++) Sum of Pairwise Distances Between Cases in Two Aligned Time Seriesdistance_lock_step_cpp
(C++) Manhattan Distance Between Two Vectorsdistance_manhattan_cpp
(C++) Distance Matrix of Two Time Seriesdistance_matrix_cpp
(C++) Russell-Rao Distance Between Two Binary Vectorsdistance_russelrao_cpp
Distance Methodsdistances
Dissimilarity Analysis of Time Series Listsdistantia
Aggregate Dissimilarity Analysis Data Frames Across Parameter Combinationsdistantia_aggregate
Boxplot of Dissimilarity Analysis Data Framesdistantia_boxplot
Hierarchical Clustering of Dissimilarity Analysis Data Framesdistantia_cluster_hclust
K-Means Clustering of Dissimilarity Analysis Data Framesdistantia_cluster_kmeans
Contribution of Individual Variables to Dissimilarity in Time Series Listsdistantia_importance
Convert Dissimilarity Analysis Data Frame to Distance Matrixdistantia_matrix
Two-Way Dissimilarity Plots of Time Series Listsdistantia_plot
Convert Dissimilarity Analysis Data Frames to Spatial Dissimilarity Networksdistantia_to_sf
Site Coordinates of Nine Interglacial Sites in Central Europeeemian_coordinates
Pollen Counts of Nine Interglacial Sites in Central Europeeemian_pollen
Data Transformation: Data Centering by Columnf_center
Data Transformation: Differencing Detrending of Zoo Time Seriesf_detrend_difference
Data Transformation: Linear Detrending of Zoo Time Seriesf_detrend_linear
Data Transformation: Hellinger Transformation by Rowsf_hellinger
Lists Available Transformation Functionsf_list
Data Transformation: Principal Components of Zoo Time Seriesf_pca
Data Transformation: Convert Values to Percentages by Rowf_percentage
Data Transformation: Convert Values to Proportions by Rowf_proportion
Data Transformation: Rescaling Values of Zoo Time Series to a New Rangef_rescale
Data Transformation: Data Centering and Scaling by Columnf_scale
Data Transformation: Data Centering and Scaling by Column Using Global Mean and Standard Deviationf_scale_global
Data Transformation: Slope of Linear Regression with Timef_slope
Data Transformation: Moving Window Smoothing of Zoo Time Seriesf_smooth_window
Data Transformation: Linear Trend of Zoo Time Seriesf_trend_linear
Site Coordinates of Fagus sylvatica Standsfagus_coordinates
Time Series Data from Three Fagus sylvatica Standsfagus_dynamics
Rainfall and Temperature in The Americashoneycomb_climate
Hexagonal Gridhoneycomb_polygons
(C++) Contribution of Individual Variables to the Dissimilarity Between Two Time Series (Legacy Version)importance_dynamic_time_warping_legacy_cpp
(C++) Contribution of Individual Variables to the Dissimilarity Between Two Time Series (Robust Version)importance_dynamic_time_warping_robust_cpp
(C++) Contribution of Individual Variables to the Dissimilarity Between Two Aligned Time Seriesimportance_lock_step_cpp
(C++) Null Distribution of Dissimilarity Scores of Two Time Seriesnull_psi_dynamic_time_warping_cpp
(C++) Null Distribution of the Dissimilarity Scores of Two Aligned Time Seriesnull_psi_lock_step_cpp
(C++) Unrestricted Permutation of Complete Rowspermute_free_by_row_cpp
(C++) Unrestricted Permutation of Casespermute_free_cpp
(C++) Restricted Permutation of Complete Rows Within Blockspermute_restricted_by_row_cpp
(C++) Restricted Permutation of Cases Within Blockspermute_restricted_cpp
Cumulative Sum of Distances Between Consecutive Cases in a Time Seriespsi_auto_distance
Auto Sumpsi_auto_sum
Cost Matrixpsi_cost_matrix
Least Cost Pathpsi_cost_path
Trims Blocks from a Least Cost Pathpsi_cost_path_ignore_blocks
Sum of Distances in Least Cost Pathpsi_cost_path_sum
Lock-Step Distancepsi_distance_lock_step
Distance Matrixpsi_distance_matrix
(C++) Psi Dissimilarity Score of Two Time-Seriespsi_dynamic_time_warping_cpp
Normalized Dissimilarity Scorepsi_equation
(C++) Equation of the Psi Dissimilarity Scorepsi_equation_cpp
(C++) Psi Dissimilarity Score of Two Aligned Time Seriespsi_lock_step_cpp
(C++) Subset Matrix by Rowssubset_matrix_by_rows_cpp
Aggregate Cases in Time Series Liststsl_aggregate
Clean Column Names in Time Series Liststsl_colnames_clean
Get Column Names from a Time Series Liststsl_colnames_get
Set Column Names in Time Series Liststsl_colnames_set
Count NA Cases in Time Series Liststsl_count_NA
Diagnose Issues in Time Series Liststsl_diagnose
Handle NA Cases in Time Series Liststsl_handle_NA tsl_Inf_to_NA tsl_NaN_to_NA
Transform Raw Time Series Data to Time Series Listtsl_init tsl_initialize
Clean Time Series Names in a Time Series Listtsl_names_clean
Get Time Series Names from a Time Series Liststsl_names_get
Set Time Series Names in a Time Series Listtsl_names_set
Tests Naming Issues in Time Series Liststsl_names_test
Get Number of Columns in Time Series Liststsl_ncol
Get Number of Rows in Time Series Liststsl_nrow
Plot Time Series Listtsl_plot
Repair Issues in Time Series Liststsl_repair
Resample Time Series Lists to a New Timetsl_resample
Simulate a Time Series Listtsl_simulate
Splits Multivariate Time Series Lists to Univariate TSLstsl_split
Summary Statistics of Time Series Liststsl_stats
Subset Time Series Lists by Time Series Names, Time, and/or Column Namestsl_subset
Time Features of Time Series Liststsl_time tsl_time_summary
Coerce Elements of Time Series List to same Time Classtsl_time_class_set
Transform Time Series List to Data Frametsl_to_df
Transform Values in Time Series Liststsl_transform
Ensures Correct Class for Time Argumentsutils_as_time
Default Block Size for Restricted Permutation in Dissimilarity Analysesutils_block_size
Check Input Arguments to 'distantia()'utils_check_args_distantia
Checks Input Matrixutils_check_args_matrix
Checks Least Cost Pathutils_check_args_path
Structural Check for Time Series Listsutils_check_args_tsl
Checks Argument xutils_check_args_zoo
Check Distance Argumentutils_check_distance_args
Checks Classes of List Elements Against Expectationutils_check_list_class
Clean Character Vector of Namesutils_clean_names
Optimize the Silhouette Width of Hierarchical Clustering Solutionsutils_cluster_hclust_optimizer
Optimize the Silhouette Width of K-Means Clustering Solutionsutils_cluster_kmeans_optimizer
Compute Silhouette Width of a Clustering Solutionutils_cluster_silhouette
Coerces Vector to a Given Time Classutils_coerce_time_class
Auto Breaks for Matrix Plotting Functionsutils_color_breaks
Default Continuous Color Paletteutils_color_continuous_default
Default Discrete Color Palettesutils_color_discrete_default
Number of Decimal Placesutils_digits
Split Dissimilarity Analysis Data Frames by Combinations of Argumentsutils_distantia_df_split
Data Frame to Matrixutils_distantia_df_to_matrix
Removes Geometry Column from SF Data Framesutils_drop_geometry
Global Centering and Scaling Parameters of Time Series Listsutils_global_scaling_params
Data Frame with Contribution of Individual Variables to Dissimilarity to Wide Formatutils_importance_df_to_wide
Titleutils_is_time
Handles Line Colors for Sequence Plotsutils_line_color
Guide for Time Series Plotsutils_line_guide
Color Guide for Matrix Plotutils_matrix_guide
Plot Distance or Cost Matrix and Least Cost Pathutils_matrix_plot
New Time for Time Series Aggregationutils_new_time utils_new_time_type
Optimize Loess Models for Time Series Resamplingutils_optimize_loess
Optimize Spline Models for Time Series Resamplingutils_optimize_spline
Convert Data Frame to a List of Data Framesutils_prepare_df
Convert Matrix to Data Frameutils_prepare_matrix
Convert List of Matrices to List of Data Framesutils_prepare_matrix_list
Handles Time Column in a List of Data Framesutils_prepare_time
Convert List of Vectors to List of Data Framesutils_prepare_vector_list
Convert List of Data Frames to List of Zoo Objectsutils_prepare_zoo_list
Rescale Numeric Vector to a New Data Rangeutils_rescale_vector
Valid Aggregation Keywordsutils_time_keywords
Dictionary of Time Keywordsutils_time_keywords_dictionary
Translates The User's Time Keywords Into Valid Onesutils_time_keywords_translate
Data Frame with Supported Time Unitsutils_time_units
Data Frame with Pairs of Time Series in Time Series Listsutils_tsl_pairs
Aggregate Cases in Zoo Time Serieszoo_aggregate
Clean Name of a Zoo Time Serieszoo_name_clean
Get Name of a Zoo Time Serieszoo_name_get
Set Name of a Zoo Time Serieszoo_name_set
Random or Restricted Permutation of Zoo Time Serieszoo_permute
Plot Zoo Time Serieszoo_plot
Resample Zoo Objects to a New Timezoo_resample
Simulate a Zoo Time Serieszoo_simulate
Get Time Features from Zoo Objectszoo_time
Convert Individual Zoo Objects to Time Series Listzoo_to_tsl
Coerce Coredata of Univariate Zoo Time Series to Matrixzoo_vector_to_matrix