Skip to content

RPhosFate

2.0.1Package record

Soil and Chemical Substance Emission and Transport Model

0packages depend
2.6Kdownloads / year
68.3%test coverage
13/13flavors OK

Overview

About

An enhanced version of the semi-empirical, spatially distributed emission and transport model PhosFate implemented in 'R' and 'C++'. It is based on the D-infinity, but also supports the D8 flow method. The currently available substances are suspended solids (SS) and particulate phosphorus (PP). A major feature is the allocation of substance loads entering surface waters to their sources of origin, which is a basic requirement for the identification of critical source areas and in consequence a cost-effective implementation of mitigation measures. References: Hepp et al. (2022) doi:10.1016/j.jenvman.2022.114514; Hepp and Zessner (2019) doi:10.3390/w11102161; Kovacs (2013) http://hdl.handle.net/20.500.12708/9468.

Changes in 2.0.1

This version introduces a new flow method, but also comes with several breaking changes.

Overview

  • Use of the D-infinity (Tarboton, 1997) instead of the D8 flow method, however, the D8 flow method can still be mimicked by rounding D-infinity flow directions to the nearest multiple of 45 degrees.
  • Weighted flow accumulations are no longer supported for the time being.
  • The basis for the calculation of the D-infinity slopes is the original digital elevation model and not the breached one with reversed stream burning as it used to be for the calculation of the D8 slopes.
  • The default value for the parameter holding the minimum bounding slope _(ns\_slp\_min)_ is now 1 instead of 0.001%.
  • The L factor is now calculated using equation\ (9) as published by Desmet and Govers (1996) and not as modified by Kovacs (2013).
  • The channel retentions of the substance outlet loads of subsurface drainages are now calculated analogous to the overland retentions of the local emissions, i.e. by using half of the respective flow path length.
  • RPhosFate now utilises the terra instead of the raster package.
  • Ceased the support for _ERDAS IMAGINE_ (\*.img) raster files and added img2tif() function can be used to convert all _ERDAS IMAGINE_ raster files in a directory and its subdirectories into _GeoTIFF_ raster files.
  • Dropped backward compatibility to major version zero.

Technical details

Show all changes in 2.0.1Hide the rest of the changes in 2.0.1
  • Input data changes:
  • Removed the layers holding the (weighted) D8 flow accumulations (_acc_ and _acc\_wtd_) and added _acc\_inf_ holding the D-infinity flow accumulations.
  • Removed the layer holding the D8 flow directions _(dir)_ and added _dir\_inf_ holding the D-infinity flow directions.
  • Removed the layer holding the D8 slopes _(slp)_ and added _slp\_inf_ holding the D-infinity slopes.
  • DEMrelatedInput() function changes:
  • Considerable adjustments to reflect the aforementioned input data changes.
  • Addition of ns_cha argument: allows for specifying the minimum D8 flow accumulation determining a channel.
  • Addition of ls_mD8 argument: allows for mimicking D8 flow directions by rounding the D-infinity flow directions to the nearest multiple of 45 degrees. Please note that this treatment is always applied to channel cells independently of this argument.
  • Removal of the cs_wgs and cs_dir arguments: These input data are no longer supported for the time being.
  • Switched to utilising the SpatRaster and SpatVector classes from the terra package instead of the RasterLayer class from the raster and the Spatial*DataFrame classes from the sp packages.
  • Added is_ths argument to the RPhosFate() and catchment() constructors: allows for specifying the number of threads to use for processing, where applicable.
  • Removed the layer holding the hydraulic radii _(rhy),_ as the calculation of the hydraulic radii is now integrated into the transport() method. This implies that the transportPrerequisites() method does not save it to disk any longer.
  • Removed the parameter holding the D8 outflow direction vector _(iv\_fDo)._ Existing parameter files containing it can still be used, but the parameter will definitely be lost upon saving the project's state.
  • Removed the transportCalcOrder() method, as the determination of the cell transport calculation order is now integrated into the transport() method. This implies that the firstRun() as well as subsequentRun() methods do not call it and the saveState() method does not save it to disk any longer.
  • The calibrationQuality() method now returns its return value invisibly.
  • Considerably revised the internal RPhosFateHelpers class.
  • Removed spatstat.geom from the imported packages list (utilised functionality is now also provided by terra).
  • Bumped the minimum tested R version from 4.2.3 to 4.3.2 using the corresponding _Posit_ public package manager snapshot.
  • Slightly improved the documentation.
  • Major internal code improvements.

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 6.5 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-09-08
  • ERROR12 OK, 1 ERROR2026-09-07
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK14 OK2026-04-22
Show 2 earlier changesHide 2 earlier changes
  • ERROR13 OK, 1 ERROR2026-04-18
  • OK14 OK2026-03-10
Advisories

none known

Documentation

In release 2.0.1
READMEYes · 226 wordsVignettesYes · 1 · dynamicNEWSYes · 100% structured · mentions 2.0.1Citation fileYes · cites a publicationWebsiteYes · pkgdown
Help pages
20
Examples that run
28%5 run in a plain check · 12 only when donttest examples are enabled (R CMD check --as-cran) · 1 never run
Exported functions with examples
95%
Documented parameters
70%
Return-value docs
100%
Help pages citing references
25%

Downloads

2.6K
CRAN downloads in the past year
Rank #15,357 · ~7/day · ~220/mo
Daily download trend is not available in this view yet.
28030 days
80190 days
2.6K1 year
Compare downloads with other packages →
Also on352 r2u3 autocran

Repository

2Stars
0Forks
0Open issues
0Open PRs
4Releases
248Commits
1Commit identities
emissionparticulate-phosphorusphosfatesource-allocationsuspended-solidstransport
248 commits · Last activity 2026-05-31 · Default branch at 2.0.1.9000, ahead of CRAN 2.0.1 (checked 2026-10-21)
Responsiveness
How these are sampled
PRs merged (all time)
100%
Median days to close, 50 most recently updated closed issues
7
Median days to close, 50 most recently updated closed PRs
0

Stars over time

2022-10-06 · 22026-07-07 · 2
PracticesBeta

14 development-tooling and community-health practices detected across 6 families in the upstream repository

Checks run against github.com/gisler/rphosfate on 2026-10-21.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux and Windows, and on R-devel

Governance and community (3)
Contributing guideIssue templatesPR template
Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-05-31 · The repository has a site deploy workflow

pkgdown site last built 2025-03-24

Coverage (1)
Coverage reporting
Show all practicesHide 2 practices
CRAN release process (1)
cran-comments.md
Lint, format, editor (4)
lintrjarlVS CodeRStudio project
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
10 external dependencies (excludes base and recommended)

Installing RPhosFate adds 6 packages (6 with compiled code, 4.7 MB of source tarballs). Heaviest: Rcpp 1.8 MB, terra 1.5 MB, RcppArmadillo 1.0 MB.

Depends (1)
R >= 3.5.0
Imports (9)
checkmategraphicsmethodsRcppstatsterratoolsutilsyaml
LinkingTo (2)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 1.0.2 (2022)
Releases (4)

Pick two releases to compare their code metrics.

  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • 2.0.1Latest
    record
    2025-03-22 · current release · diff ↗ ·
    removed 1 export
    transportCalcOrder
    added 1 export
    img2tif
  • R
    R 4.4.0 released · 2024-04-24
  • 1.0.4
    record
    2023-10-07 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 1.0.3
    record
    2023-03-06 · diff ↗
  • 1.0.2
    record
    2022-09-21
  • R
    R 4.2.0 released · 2022-04-22

Package metadata

First published
2022-09-21
Total releases
4 / 4 yrs
License
AGPL (>= 3) OSI
Minimum R
≥ 3.5.0
Download size
1.3 MB

Cite

Cite this package

Run in R for the authors' entry:

citation("RPhosFate")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.1016/j.jenvman.2022.114514, 10.3390/w11102161.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for RPhosFate version 2.0.1 [Data set]. HJJB, LLC. Data release v2026-10-24. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy