| Type: | Package |
| Title: | Empirical Cumulative Distribution Function Niche Modeling Tools |
| Version: | 0.1.0 |
| Description: | Simulate ecological niche models using Mahalanobis distance, transform distances to suitability with 1 - empirical cumulative distribution function and 1 - chi-squared, and generate comparison figures. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| RoxygenNote: | 7.3.3 |
| Depends: | R (≥ 4.0.0) |
| Imports: | ggplot2, lemon, MASS, stats |
| Suggests: | knitr, rmarkdown, roxyglobals, tictoc |
| VignetteBuilder: | knitr |
| Config/roxyglobals/filename: | globals.R |
| Config/roxyglobals/unique: | FALSE |
| NeedsCompilation: | no |
| Packaged: | 2025-12-16 16:17:01 UTC; luizesser |
| Author: | Dayani Bailly |
| Maintainer: | Luíz Fernando Esser <luizesser@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2025-12-19 20:20:22 UTC |
Create distance–suitability plot
Description
Create distance–suitability plot
Usage
create_distance_suitability_plot(analysis_results)
Arguments
analysis_results |
List returned by |
Value
A ggplot object.
Examples
# Create ECDF-niche based on personalized options:
ecdf_niche <- ecdf_niche(n = 3,
n_population = 20000,
sample_sizes = seq(50, 1000, 50),
seed = 123)
# Plot analysis results
create_distance_suitability_plot(ecdf_niche)
Niche analysis using ECDF and chi-squared
Description
Simulate niche suitability from Mahalanobis distance using both chi-squared and empirical CDF transformations, for a given number of predictor variables.
Usage
ecdf_niche(
n,
n_population = 10000L,
sample_sizes = seq(20L, 500L, 20L),
seed = NULL
)
Arguments
n |
Integer; number of predictor variables (dimensions). |
n_population |
Integer; size of simulated environmental population. |
sample_sizes |
Integer vector of sample sizes to evaluate. |
seed |
Optional integer seed for reproducibility. |
Value
A list with:
corplot: ggplot object with correlation vs sample size.
sample_data: matrix of simulated sample points.
sample_niche: numeric vector of “true” niche suitability.
chisq_suits: numeric vector, 1 - pchisq(Mahalanobis).
ecdf_suits: numeric vector, 1 - ECDF(Mahalanobis).
mahal_dists: numeric vector of Mahalanobis distances.
Examples
# Create ECDF-niche based on personalized options:
ecdf_niche <- ecdf_niche(n = 3,
n_population = 20000,
sample_sizes = seq(50, 1000, 50),
seed = 123)
Run full ECDF–Mahalanobis analysis
Description
Convenience function that reproduces the three figures from the original manuscript for 1–5 dimensions.
Usage
run_ecdf_mahal_analysis(dims = 1:5, seed = 3L)
Arguments
dims |
Integer vector of dimensions (default 1:5). |
seed |
Optional seed for reproducibility. |
Value
A list containing:
analyses: list of ecdf_niche() outputs.
figure1, figure2, figure3: grobs with arranged plots.
Examples
# Recreate original manuscript output:
set.seed(3)
full_res <- run_ecdf_mahal_analysis(dims = 1:5)