swrc_example: Example soil water retention dataset

swrc_exampleR Documentation

Example soil water retention dataset

Description

A fully synthetic soil characterisation dataset generated to illustrate the functions in soilFlux. Its column layout follows the conventions common to soil characterisation databases (texture fractions, organic carbon, bulk density, standard depth intervals and matric-head points); van Genuchten curves are used to produce internally consistent water-content observations.

Usage

swrc_example

Format

A data frame with 4 800 rows and 14 columns:

PEDON_ID

Character. Unique soil profile identifier (e.g. "P0001").

sand_total

Numeric. Total sand content (%).

silt

Numeric. Silt content (%).

clay

Numeric. Clay content (%).

soc

Numeric. Soil organic carbon (%).

bd

Numeric. Bulk density (g/cm3).

sand_vf

Numeric. Very fine sand fraction (%).

sand_f

Numeric. Fine sand fraction (%).

sand_m

Numeric. Medium sand fraction (%).

sand_c

Numeric. Coarse sand fraction (%).

matric_head

Numeric. Matric head (cm H2O, positive).

water_content

Numeric. Volumetric water content (m3/m3). Approximately 1% of values are NA to simulate missing measurements.

depth

Character. Depth interval (e.g. "0-5", "5-15", etc.).

Texture

Character. USDA texture class (one of: Sand, Loamy Sand, Sandy Loam, Loam, Silt Loam, Clay Loam, Clay).

Details

No third-party or institutional data are included in or distributed with this package. Every value in swrc_example is generated by data-raw/create_example_data.R from set.seed(2025) and is exactly reproducible by re-running that script.

The dataset contains 120 unique profiles (PEDON_ID) across five depth intervals (0–5, 5–15, 15–30, 30–60, 60–100 cm) and eight matric-head points per depth (pF approximately 0, 1, 1.5, 2, 2.5, 3, 4.2, 7). Profiles are evenly distributed across seven USDA texture classes.

Water-content observations were generated with the van Genuchten (1980) equation using parameters that vary realistically with texture and depth, then small Gaussian noise was added.

Source

Synthetic dataset generated by data-raw/create_example_data.R.

References

van Genuchten, M. T. (1980). A closed-form equation for predicting the hydraulic conductivity of unsaturated soils. Soil Science Society of America Journal, 44(5), 892–898.

Examples

data("swrc_example")
head(swrc_example)
table(swrc_example$Texture[!duplicated(swrc_example$PEDON_ID)])

# Prepare for modelling
df <- prepare_swrc_data(swrc_example, depth_col = "depth")


soilFlux documentation built on Dec. 4, 2026, 5:10 p.m.