Skip to content

Repository files navigation

ALFAM2

Model for ammonia volatilization (loss) from field-applied manure.

Maintainer

Sasha D. Hafner. Contact information here: https://www.au.dk/vis/person/sasha.hafner@bce.au.dk.

Installation

The ALFAM2 package is on CRAN, so it can be installed in the normal way:

install.packages("ALFAM2")

This will install the latest version available on CRAN.

Earlier versions can still be found here on the ALFAM2 GitHub repository. And as package development continues, there will be times when the CRAN version is not the latest one. Installation of packages from GitHub requires a package called remotes (or the devtools package, which can be used exactly like remotes below). You can run the code below to install remotes and ALFAM2.

If you don't already have it, first install remotes from CRAN.

install.packages("remotes")

Then install the latest ALFAM2 release from this ALFAM2 repository with the following command.

remotes::install_github("AU-BCE-EE/ALFAM2@*release", build_vignettes = TRUE)

The build_vignettes argument is needed in order to get the vignettes.

You can just pull from the master branch (AU-BCE-EE/ALFAM2) with the following command, but you may get some new changes not yet included in a release.

remotes::install_github("AU-BCE-EE/ALFAM2", build_vignettes = TRUE)

And you can get any specific release (e.g., to check out a specific version used in a particular paper) with the following syntax.

remotes::install_github("AU-BCE-EE/ALFAM2@v3.2", build_vignettes = TRUE)

See the Releases page for all available releases. The @v3.2 bit in the command above is from the release tag.

For other branches using the ref argument, but this doesn't typically make sense for regular users. If you are sure that you need another branch (for example, to test new features), use ref. For example, for the main development branch named dev:

remotes::install_github("AU-BCE-EE/ALFAM2", ref = "dev", build_vignettes = TRUE)

Package use

Once the package is installed, load it in R.

library(ALFAM2)

And see a vignette to get started.

vignette("ALFAM2-start")

Or download the CRAN version here.

Citations

When referring to the ALFAM2 model predictions in publications, be sure to include

  1. the version of the software used (e.g., "R package version 4.1.8") and
  2. the parameter set used (e.g., "parameter set 3").

You can get citations to the R package and relevant publications with citation('ALFAM2') in R.

Model description

The most recent paper describes additions to the model and the most recent parameter set (3):

Hafner, S.D., Pedersen, J., Fuß, R., Kamp, J.N., Dalby, F.R., Amon, B., Pacholski, A., Adamsen, A.P.S., Sommer, S.G., 2025. Improved tools for estimation of ammonia emission from field-applied animal slurry: Refinement of the ALFAM2 model and database. Atmospheric Environment 340, 120910. https://doi.org/10.1016/j.atmosenv.2024.120910. https://doi-org.ez.statsbiblioteket.dk/10.1016/j.atmosenv.2024.120910

The following paper describes the original model in some detail:

Hafner, S.D., Pacholski, A., Bittman, S., Carozzi, M., Chantigny, M., Génermont, S., Häni, C., Hansen, M.N., Huijsmans, J., Kupper, T., Misselbrook, T., Neftel, A., Nyord, T., Sommer, S.G., 2019. A flexible semi-empirical model for estimating ammonia volatilization from field-applied slurry. Atmospheric Environment 199: 474-484. https://doi.org/10.1016/j.atmosenv.2018.11.034

Download a copy here.

As shown in the figure below, the ALFAM2 model tracks applied ammonia (as "total ammoniacal nitrogen", TAN) after field application. The numerical value of the "primary" parameters shown below (r and f terms) determine the rate and trajectory of emission. The value of these parameters are determined by the value of predictor variables and the "secondary" parameter set.

schematic

Bugs and requests

Please use the Issues page.

Project information

See www.alfam.dk for more information and resources.

About

Model and data on ammonia volatilization (loss) from field-applied manure

Resources

Stars

9 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages