VeraCrop 0.1.0

Initial release.

CRAN resubmission fixes

Update: bootstrap confidence intervals for the CPA decomposition

Added bootstrap_cpa(), which uses case resampling (nonparametric bootstrap) to compute percentile confidence intervals for the overall yield gap and for each variable’s Gap_Component and Share_Percent in the CPA table. The significant-variable set is held fixed across resamples so the intervals describe the uncertainty of the decomposition itself; an optional check_selection_stability diagnostic reports how often each variable would be independently re-selected across resamples.

bootstrap_cpa() correctly includes the model intercept when computing Yield_Mean/Yield_Opt for each resample, so these are reported on the actual yield scale (an early internal version omitted it, which zeroed out only these two summary rows while leaving Yield_Gap and the per-variable Gap_Component/Share_Percent values unaffected, since the intercept’s own contribution to the gap is always zero).

bootstrap_cpa() now auto-tunes top_percentile and min_top_samples from the sample size using the exact same thresholds as yield_gap_analysis(), instead of a fixed top_percentile = 0.99 and min_top_samples = 20. On datasets smaller than 100 rows, the fixed defaults did not match what yield_gap_analysis() actually used internally, producing a different high-yield subset and therefore different Yield_Mean/Yield_Opt/Gap_Component values than the analysis being bootstrapped. Both parameters can still be set explicitly to override the auto-tuned value.

Update: bundled example datasets

Three real field-trial datasets are now bundled with the package and used throughout the documentation and vignette in place of synthetic data:

See ?wheat1, ?wheat2, and ?sugarcane1 for full column descriptions.

Update: variable selection method choice

yield_gap_analysis() now supports selection_method = "aic" as an alternative to the default "ftest":

Update: whitespace trimming and small-sample/high-dimensionality fixes

Overview

VeraCrop provides an end-to-end workflow for yield gap analysis using Comparative Performance Analysis (CPA): automatic variable-type detection, preprocessing (missing-value handling, encoding, scaling, filtering), regression diagnostics, variable selection with cross-validation, and yield gap decomposition with reporting (Excel export, plots).

Key functions

Notes on correctness

The following were identified and corrected during development, primarily through end-to-end testing against real agronomic data rather than static code review alone. They are listed here because they affect the numeric results a user would get from earlier development snapshots of this code, not because they represent changes in the current public API.

Testing

The package ships with a testthat suite covering preprocessing, encoding, filtering, scaling, diagnostics, variable selection, yield gap computation, and the end-to-end pipeline.