Changelog
Source:NEWS.md
litterfitter 0.3.0
CRAN release: 2026-11-22
This is the first CRAN release since 0.1.4. It also includes all changes from 0.1.5 and 0.2.0 (listed below), which were not released to CRAN.
New features
- New
tidy(),glance()andaugment()methods (from thegenericspackage, compatible withbroom) return fits as data frames (#29):-
tidy(): parameter estimates, with bootstrap standard errors and percentile intervals when abootstrap_parameters()result is supplied. -
glance(): a one-row summary with information criteria, time to 50% mass loss and steady state. -
augment(): data with fitted values and residuals, or predictions at new times, with an optional bootstrap uncertainty band (.lower,.upper). -
tidy()for bootstrap output gives the replicates in long format.
-
- New
fit_litter_all()fits several models to the same data and returns alitfit_list;as_litfit_list()combines existing fits.glance()on alitfit_listgives a model comparison table sorted by AICc withdelta_AICc;tidy(),augment(),coef(),print()and[also work on it. - New
fit_element()fits element (nutrient) dynamics: proportional element remaining (e.g. N/N0) as a function of proportional mass remaining, using the Parton et al. (2007) import model (reparameterised for proportional mass). It returns anelementfitobject withprint,plot,coef,fitted,residuals,predict,nobs,logLik,tidy,glance(including the peak element remaining and the mass at the peak) andaugmentmethods, and is supported bybootstrap_parameters(). Based on work by Baptiste Wijas on theimportbranch (#30). - Plotting has been modernised (#28):
- New
autoplot()methods (ggplot2, in Suggests) forlitfit,elementfit,litfit_listandlitfit_bootstrapobjects, with optional bootstrap uncertainty bands, the fitted equation as subtitle, models labelled by their difference in AICc, and bootstrap distributions of all parameters in facets. -
plot()forlitfitandelementfitobjects acceptsbootto draw an uncertainty band; user arguments such asxlabormainoverride the defaults; the equation is placed in a corner so it no longer overlaps the data. - New
plot()method forlitfit_listwith a colour-blind safe (Okabe-Ito) palette and an aligned table of AIC, AICc and BIC. -
plot_multiple_fits()keeps its interface but now usesfit_litter_all()and the newplot()method, returns alitfit_list, and can plot existing fits without refitting. -
plot()on a bootstrap can show several columns by number or name, or all of them (coef.index = "all"), and the shaded interval is set byconf.level. - Base plots now look slightly different (palette, legend layout, equation position).
- New
- The missing-value warning from
fit_litter()now has classlitterfitter_missing_removed. - New dependencies:
genericsandutils(Imports);ggplot2andvdiffr(Suggests).
Behaviour changes
-
fit_litter()again fits a single harvest, or replicates at a single time, for models whose curve starts at mass 1 at time 0 (all exceptneg.exp.limit), as 0.1.x did. The unreleased 0.2.0 rejected these data, which broke workflows that fitneg.expk for each species and site. A fit is now allowed when there are at least as many distinct harvest times after time 0 as parameters. Fits that are possible only because of this rule give a once-per-session warning of classlitterfitter_origin_only. - AICc is
NAwhen it is undefined (fewer than the number of parameters plus two observations), instead of a value with a zero or negative denominator.
litterfitter 0.2.0 (GitHub only; not released to CRAN)
Behaviour changes
-
fit_litter()now defaults tomodel = "neg.exp"when no model is given. -
fit_litter()warns when mass remaining values are above 1 or below 0 (see Bug fixes). - Fits can differ slightly from earlier versions because of the smaller optimiser step.
-
steady_state()returnsInfforneg.exp.limitfits with B > 0 (previously a string). -
time_to_prop_mass_remaining()returnsNA(with a warning) when the threshold is never reached, and its result is now exact rather than read off a grid, so values may differ slightly. -
coef()now returns a named vector.
Bug fixes
-
fit_litter()now defaults tomodel = "neg.exp"and rejects unknown model names (previously omittingmodelgave “first argument has length > 1”). - Proportional mass remaining values above 1 (apparent mass gain from measurement error, common early in decomposition or when decomposition is slow) are kept in the fit but now trigger an informative warning of class
litterfitter_mass_above_one; when the data also show little overall mass loss the warning says that parameters may be poorly constrained and derived quantities are extrapolations (#21). Slightly negative values (down to -0.1) are kept with alitterfitter_mass_below_zerowarning; clearly negative values or percentages are errors. -
fit_litter()now rejects infinite values, invaliditers, and data with a single time point; drops missing observations with a warning; and requires more observations than parameters. - Boundary warnings now name the parameters on a bound, and hint that the default bounds assume time in years when time values are large.
- Litter fits and their bootstrap replicates use analytic gradients for all six curves (#27), improving accuracy for small rates such as rates per day.
discrete.seriesnow supports equal pool rates. Element fits and calls withgr = NULLuse finite differences (defaultndeps = 1e-4). Built-in gradients use a default limit of 500 optimizer iterations so thatcont.qualityfits can converge along a shallow minimum. An explicitcontrol$maxittakes precedence. In a local benchmark onpineneedles(median of three fixed-seed runs), the 200-startdiscrete.seriesfit took 0.078 s versus 0.109 s previously, and 200 bootstrap replicates took 0.053 s versus 0.080 s. - Weibull fits and bootstraps require a strictly positive lower bound for the scale parameter
beta. Bootstrap replicates that reach the optimizer’s iteration limit or otherwise fail to converge are recorded asNA. - The “may not have found global best fit” check now compares the 5 best fits (it previously compared the 5 worst) and no longer errors when fewer than 5 starts succeed.
-
steady_state()forneg.exp.limitnow returns a number (Infwhen B > 1e-4, otherwise A / k) instead of a string, fixing errors insummary()andbootstrap_parameters(). -
bootstrap_parameters()records failed replicates asNAinstead of erroring. -
time_to_prop_mass_remaining()now usesuniroot(): exact, fast, independent of time units, and returnsNAwith a warning when the threshold is never reached. - Plot curves use a fixed number of points regardless of time units;
plot_multiple_fits()no longer clips mass values above 1. - Fixed Weibull and discrete.series formula display in
plot.litfit(). -
plot.litfit()always shows the (0, 1) starting point on the y axis (#7). - All six models are now documented in
?fit_litter;neg.exphad been accidentally commented out andneg.exp.limitwas missing (#22). -
time_to_prop_mass_remaining()gives a clear error for a missingthreshold.mass. - Restored input-validation tests that were lost in 0.1.5, and greatly expanded the test suite (edge cases for inputs, every model, derived quantities checked against closed-form results, bootstrap failures, methods and plots).
New features
- New methods (#19):
print.litfit(),logLik.litfit()(soAIC(fit1, fit2)andBIC()work),nobs.litfit(),residuals.litfit()andsummary.litfit_bootstrap(). -
coef()and bootstrap output now carry parameter names. - New
quietargument tofit_litter()suppresses the “successful fits” message. -
plot_multiple_fits()invisibly returns the fitted models.
litterfitter 0.1.5
- fixing url in the readme, which is causing a note in the cran checks
- Modernized package structure and code style (styler, lintr)
- Updated GitHub Actions workflows for better CI/CD support (Ubuntu, macOS, Windows)
- Updated dependencies (R >= 4.1.0)
litterfitter 0.1.4
CRAN release: 2025-08-21
- removed plyr dependency for long term ease of maintenance
- updated testing framework to testthat v3 style
- fixed a testing instability that was causing occasional warnings
- updating doi syntax