Changelog
Source:NEWS.md
afsetools 0.3.0
New features
BNF functions module (
R/bnf_functions.R): 5 exported functions for biological nitrogen fixation —calc_crop_bnf(),calc_weed_bnf(),calc_nonsymbiotic_bnf(),calc_bnf(), andsummarize_bnf()— with literature-based environmental modifiers for temperature, water stress, soil organic matter, pH, and clay content.IPCC biomass coefficients: 6 new sheets in
Biomass_coefs.xlsxwith crop residue, root, and mapping coefficients verified against IPCC 2006 Vol.4 Ch.11 Table 11.2.Data-driven NPP model: NPP model coefficients extracted to Excel (
NPP_model_coefssheet).calculate_potential_npp()now reads coefficients from the data table instead of hardcoded literals.Simple mode for crop NPP functions:
calculate_crop_npp(),calculate_crop_residues(),calculate_crop_roots(), andcalculate_npp_dm_c_n()gain amodeparameter ("full"/"simple") that auto-detects available columns and adjusts calculations accordingly.Crop-group-specific residue/root helper data: new lookup tables for residue shares, weed NPP scaling, fallow cover, and root-shoot N response.
Feed distribution:
redistribute_feed()function for multi-level feed allocation with diagnostics, plusmax_intake_shareloaded fromLivestock_coefs.xlsx.
Bug fixes
- Fixed crop-specific irrigation residue factor and reduced rice
HI_gap_factor. - Fixed N-input root-shoot adjustment:
calculate_crop_roots()now uses theN_input_RS_adjdata table viafindInterval()instead of ignoring it. - Added
DescToolsandzooto package dependencies (previously undeclared). - Fixed
stats::quantile()call incalculate_footprints()draught share calculation (was missing namespace prefix). - Replaced non-ASCII box-drawing characters in
redistribute_feed()diagnostics with ASCII equivalents for portable package compliance. - Fixed
%!in%operator documentation to avoid invalid Rd\namefield. - Moved unused
data.tableandreadxlfrom Imports to Suggests. - Added comprehensive
globalVariables()declarations for all NSE column names across the package (eliminates R CMD check NOTEs).
Documentation
- Expanded
DATA_REFERENCE.mdto 80+ objects with IPCC and NPP sections. - Complete roxygen2 rewrite for
calculate_potential_npp()and NPP model coefficient documentation. - Added
Names_BNF,Pure_legs,NPP_model_coefs, andmax_intake_shareto pkgdown reference index.
afsetools 0.2.0
- Removed
Filling,FillingProxy,fill_na_with_sum(migrated towhep). - Cross-repo dependency fixes and code audit.
- Added
redistribute_feed()function. - Aligned
calculate_footprints()with General reference data.