https://github.com/traitecoevo/litterfitter
Package for fitting and testing alternative models for single cohort litter decomposition data
https://github.com/traitecoevo/litterfitter
carbon carboncycle decomposition ecology-modelling soil
Last synced: 4 months ago
JSON representation
Package for fitting and testing alternative models for single cohort litter decomposition data
- Host: GitHub
- URL: https://github.com/traitecoevo/litterfitter
- Owner: traitecoevo
- License: other
- Created: 2013-11-18T23:41:15.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2026-01-29T00:20:18.000Z (4 months ago)
- Last Synced: 2026-01-29T15:39:50.649Z (4 months ago)
- Topics: carbon, carboncycle, decomposition, ecology-modelling, soil
- Language: R
- Homepage: http://traitecoevo.github.io/litterfitter/
- Size: 17.9 MB
- Stars: 5
- Watchers: 8
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: NEWS.md
- License: LICENSE
Awesome Lists containing this project
README
# litterfitter 
> R package for fitting and testing alternative models for single cohort
> litter decomposition data
[](https://github.com/traitecoevo/litterfitter/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/traitecoevo/litterfitter?branch=master)
[](https://onlinelibrary.wiley.com/doi/10.1111/2041-210X.12138)
[](https://cran.r-project.org/package=litterfitter)
### Installation
``` r
#install.packages("remotes")
remotes::install_github("cornwell-lab-unsw/litterfitter")
library(litterfitter)
```
### Getting started
At the moment there is one key function which is `fit_litter` which can
fit 6 different types of decomposition trajectories. Note that the
fitted object is a `litfit` object
``` r
fit <- fit_litter(time=c(0,1,2,3,4,5,6),
mass.remaining =c(1,0.9,1.01,0.4,0.6,0.2,0.01),
model="weibull",
iters=500)
class(fit)
```
You can visually compare the fits of different non-linear equations with
the `plot_multiple_fits` function:
``` r
plot_multiple_fits(time=c(0,1,2,3,4,5,6),
mass.remaining=c(1,0.9,1.01,0.4,0.6,0.2,0.01),
model=c("neg.exp","weibull"),
iters=500)
```

Calling `plot` on a `litfit` object will show you the data, the curve
fit, and even the equation, with the estimated coefficients:
``` r
plot(fit)
```

The summary of a `litfit` object will show you some of the summary
statistics for the fit.
#> Summary of litFit object
#> Model type: weibull
#> Number of observations: 7
#> Parameter fits: 4.19
#> Parameter fits: 2.47
#> Time to 50% mass loss: 3.61
#> Implied steady state litter mass: 3.71 in units of yearly input
#> AIC: -3.8883
#> AICc: -0.8883
#> BIC: -3.9965
From the `litfit` object you can then see the uncertainty in the
parameter estimate by bootstrapping