tests/README.md

Tests for GeometricMorphometricsMix Package

This directory contains comprehensive unit tests for the disparity_resample() function using the testthat framework.

Test Structure

testthat.R

Main test runner file that sets up the testing environment.

Test Files

  1. test-disparity_resample.R - Main comprehensive test suite
  2. Input validation tests
  3. Data type handling (matrix, data frame, vector, 3D array)
  4. All statistical methods (multivariate variance, mean pairwise distance, etc.)
  5. Bootstrap vs rarefaction methods
  6. Confidence interval calculations
  7. Missing data handling
  8. Edge cases and error conditions

  9. test-disparity_resample_helpers.R - Internal function tests

  10. Tests for helper functions like muvar(), meanpairwiseEuclideanD()
  11. Validation function tests
  12. Data preparation function tests
  13. Sample size resolution tests

  14. test-disparity_resample_methods.R - S3 method tests

  15. print.disparity_resample() method tests
  16. plot.disparity_resample() method tests
  17. Output formatting and display tests
  18. Confidence interval overlap assessment tests

  19. test-disparity_resample_integration.R - Integration and edge case tests

  20. Tests with package datasets
  21. Large dataset performance tests
  22. Extreme value handling
  23. Memory efficiency tests
  24. Cross-platform compatibility tests

Test Coverage

The test suite covers:

Core Functionality

Input Validation

Statistical Accuracy

S3 Methods

Dependencies

Running the Tests

To run all tests:

library(testthat)
library(GeometricMorphometricsMix)
test_check("GeometricMorphometricsMix")

To run specific test files:

test_file("tests/testthat/test-disparity_resample.R")

Test Dependencies

The tests require: - testthat (>= 3.0.0) - Core testing framework - GeometricMorphometricsMix - The package being tested

Optional packages (tests will skip if not available): - MASS - For multivariate normal data generation - geometry - For convex hull volume tests - nlshrink - For Claramunt proper variance tests - Morpho - For 3D array handling tests - ggplot2 - For plot method tests

Notes

Test Statistics

Total test count: ~100+ individual test cases across 4 test files Coverage: All major functions and edge cases of disparity_resample()



Try the GeometricMorphometricsMix package in your browser

Any scripts or data that you put into this service are public.

GeometricMorphometricsMix documentation built on April 18, 2026, 1:06 a.m.