R Under development (unstable) (2025-09-24 r88873 ucrt) -- "Unsuffered Consequences" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # This file is part of the standard setup for testthat. > # It is recommended that you do not modify it. > # > # Where should you do additional test configuration? > # Learn more about the roles of various files in: > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview > # * https://testthat.r-lib.org/articles/special-files.html > > library(testthat) > library(FishDiveR) FishDiveR version 1.0.1. Facilitating classification of aquatic animal behaviours from vertical movement data. Type 'citation("FishDiveR")' for citing this R package in publications. > > test_check("FishDiveR") Maximum depth is 262.2 Data sampling interval is 60 seconds Plotting every 10 records There are less than 2 representatives available for cluster 2 Cluster 1 dates 2000-01-08 Tag: data Cluster 1 dates 2000-01-09 Tag: data Cluster 2 dates 2000-01-10 Tag: data Cluster 3 dates 2000-01-03 Tag: data Cluster 3 dates 2000-01-02 Tag: data Cluster 4 dates 2000-01-04 Tag: data Cluster 4 dates 2000-01-05 Tag: data Output folder: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/6_Cluster-plots.K=4 Maximum depth is 262.2 Data sampling interval is 60 seconds Plotting every 600 seconds There are less than 2 representatives available for cluster 2 Cluster 1 dates 2000-01-08 Tag: data Cluster 1 dates 2000-01-09 Tag: data Cluster 2 dates 2000-01-10 Tag: data Cluster 3 dates 2000-01-03 Tag: data Cluster 3 dates 2000-01-02 Tag: data Cluster 4 dates 2000-01-04 Tag: data Cluster 4 dates 2000-01-05 Tag: data Output folder: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/6_Cluster-plots.K=4_shaded Tag ID = data Depth sampling interval is 60 seconds Number of depth values corrected (above 0): 0 Mean depth = 81.5 SD = 87.6 Maximum depth = 262.2 Number of full days in dataset: 10 Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/archive_days.rds Data sampling interval is 60 seconds Plotting every 10 records Maximum depth is 256.6 meters Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/tag_archive.pngData has been filtered between X-axis limits Data sampling interval is 60 seconds Plotting every 600 seconds Maximum depth is 252.5 meters Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/tag_archive.png Analysing tag ID data No 'my.w' in global environment. Creating new wavelet. Starting wavelet transformation... ... and simulations... | | | 0% | |= | 1% | |= | 2% | |== | 3% | |=== | 4% | |==== | 5% | |==== | 6% | |===== | 7% | |====== | 8% | |====== | 9% | |======= | 10% | |======== | 11% | |======== | 12% | |========= | 13% | |========== | 14% | |========== | 15% | |=========== | 16% | |============ | 17% | |============= | 18% | |============= | 19% | |============== | 20% | |=============== | 21% | |=============== | 22% | |================ | 23% | |================= | 24% | |================== | 25% | |================== | 26% | |=================== | 27% | |==================== | 28% | |==================== | 29% | |===================== | 30% | |====================== | 31% | |====================== | 32% | |======================= | 33% | |======================== | 34% | |======================== | 35% | |========================= | 36% | |========================== | 37% | |=========================== | 38% | |=========================== | 39% | |============================ | 40% | |============================= | 41% | |============================= | 42% | |============================== | 43% | |=============================== | 44% | |================================ | 45% | |================================ | 46% | |================================= | 47% | |================================== | 48% | |================================== | 49% | |=================================== | 50% | |==================================== | 51% | |==================================== | 52% | |===================================== | 53% | |====================================== | 54% | |====================================== | 55% | |======================================= | 56% | |======================================== | 57% | |========================================= | 58% | |========================================= | 59% | |========================================== | 60% | |=========================================== | 61% | |=========================================== | 62% | |============================================ | 63% | |============================================= | 64% | |============================================== | 65% | |============================================== | 66% | |=============================================== | 67% | |================================================ | 68% | |================================================ | 69% | |================================================= | 70% | |================================================== | 71% | |================================================== | 72% | |=================================================== | 73% | |==================================================== | 74% | |==================================================== | 75% | |===================================================== | 76% | |====================================================== | 77% | |======================================================= | 78% | |======================================================= | 79% | |======================================================== | 80% | |========================================================= | 81% | |========================================================= | 82% | |========================================================== | 83% | |=========================================================== | 84% | |============================================================ | 85% | |============================================================ | 86% | |============================================================= | 87% | |============================================================== | 88% | |============================================================== | 89% | |=============================================================== | 90% | |================================================================ | 91% | |================================================================ | 92% | |================================================================= | 93% | |================================================================== | 94% | |================================================================== | 95% | |=================================================================== | 96% | |==================================================================== | 97% | |===================================================================== | 98% | |===================================================================== | 99% | |======================================================================| 100% Class attributes are accessible through following names: series loess.span dt dj Wave Phase Ampl Power Power.avg Power.pval Power.avg.pval Ridge Period Scale nc nr coi.1 coi.2 axis.1 axis.2 date.format date.tz Wavelet saved to D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/temp/data/1_Wavelets/data_wavelet_p_val.rds Analysing tag ID data No 'my.w' in global environment. Creating new wavelet. Starting wavelet transformation... Class attributes are accessible through following names: series loess.span dt dj Wave Phase Ampl Power Power.avg Power.pval Power.avg.pval Ridge Period Scale nc nr coi.1 coi.2 axis.1 axis.2 date.format date.tz Wavelet saved to D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/1_Wavelets/data_wavelet.rds Output folder: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/2_Wavelet_Figures/ Running create_wavelet_stats() on tag ID data Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/3_Stats/data_waveStats.csv Running create_depth_stats() on tag ID data Output folder: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/3_Stats/data_depthStats.csv Running create_depth_stats() on tag ID data Using fixed sunrise and sunset times to calculate diel statistics Archive updated with diel periods Output folder: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/3_Stats/data_depthStats.csv Running create_depth_stats() on tag ID data Reading in GPS locations. Using actual sunrise and sunset times to calculate diel statistics Archive updated with diel periods based on GPS calculated times Output folder: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/3_Stats/data_depthStats.csv Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/4_PCA/pc_data.rds Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/4_PCA/pc_data.rds Non-numerical columns being excluded: [1] "tag_ID" "date_only" 9 principal components of 9 have eigenvalues >= 1 Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/4_PCA/eigenvalues_cum_var.csv Using cumulative variance threshold: Keeping 4 principal components to reach 99 % variance Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/4_PCA/pc_results.rds contains the selected number of principal components. Non-numerical columns being excluded: [1] "tag_ID" "date_only" 7 principal components of 9 have eigenvalues >= 1 Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/4_PCA/eigenvalues_cum_var.csv Keeping 3 PC's contributing to a cumulative 91.69187 % of variance Output folder: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/4_PCA Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/4_PCA/pc_results.rds contains the selected number of principal components. Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/4_PCA/pc_scores.rds Output folder: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/4_PCA Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/4_PCA/pc_scores.rds Saving combined metrics to: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/5_k-means/combined_stats.rds If kmeans_data is a combination of PC scores and depth data. Please standardise the data as this can greatly impact the reliability of the results. K = 2 Average silhouette width = 0.523 1 2 9 1 K = 3 Average silhouette width = 0.49 1 2 3 5 4 1 K = 4 Average silhouette width = 0.437 1 2 3 4 1 4 2 3 K = 5 Average silhouette width = 0.362 1 2 3 4 5 3 1 1 3 2 K = 6 Average silhouette width = 0.376 1 2 3 4 5 6 2 1 1 1 2 3 K = 7 Average silhouette width = 0.314 1 2 3 4 5 6 7 1 1 1 1 1 3 2 K = 8 Average silhouette width = 0.219 1 2 3 4 5 6 7 8 1 2 2 1 1 1 1 1 Optimal number of clusters according to gap statistic: 2 Single tag output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/5_k-means/Select_k.3_PCs.png Standardising k-means input. K = 2 Average silhouette width = 0.499 1 2 5 5 K = 3 Average silhouette width = 0.586 1 2 3 5 2 3 K = 4 Average silhouette width = 0.642 1 2 3 4 2 2 5 1 K = 5 Average silhouette width = 0.518 1 2 3 4 5 2 3 1 2 2 K = 6 Average silhouette width = 0.392 1 2 3 4 5 6 1 1 3 1 2 2 K = 7 Average silhouette width = 0.243 1 2 3 4 5 6 7 1 3 2 1 1 1 1 K = 8 Average silhouette width = 0.154 1 2 3 4 5 6 7 8 1 1 1 1 3 1 1 1 Single tag output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/5_k-means/Select_k.3_PCs.png If kmeans_data is a combination of PC scores and depth data. Please standardise the data as this can greatly impact the reliability of the results. Cluster Days in Cluster 1 1 2 2 2 1 3 3 5 4 4 2 [1] "Total of 10 days of data" tag_ID cluster days_in_cluster 1 data 1 2 2 data 2 1 3 data 3 5 4 data 4 2 Output folder: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/5_k-means Standardising k-means input. Cluster Days in Cluster 1 1 2 2 2 1 3 3 2 4 4 5 [1] "Total of 10 days of data" tag_ID cluster days_in_cluster 1 data 1 2 2 data 2 1 3 data 3 2 4 data 4 5 Output folder: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/5_k-means Loading tag data TDR Single tag k-means loaded Maximum depth is 262.2 Data sampling interval is 60 seconds Plotting every 10 records Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/data_TDR_k=4.png Loading tag data TDR Single tag k-means loaded Maximum depth is 262.2 Data sampling interval is 60 seconds Data has been filtered between X-axis limits Plotting every 600 seconds Output file: D:\temp\2025_09_25_11_40_16_1887\Rtmp4yhcRK/data/data_TDR_k=4.png [ FAIL 0 | WARN 0 | SKIP 0 | PASS 36 ] > > proc.time() user system elapsed 75.34 16.71 97.18