parse_depth: Parse a soil depth string into midpoint and label

View source: R/utils.R

parse_depthR Documentation

Parse a soil depth string into midpoint and label

Description

Accepts strings of the form "0-5", "5-15", "100", etc. and returns the numeric midpoint and a human-readable label (e.g. "0-5 cm").

Usage

parse_depth(s)

Arguments

s

A character string describing a depth interval or single depth.

Value

A named list with elements:

mid

Numeric midpoint in cm.

label

Character label, e.g. "0-5 cm".

Examples

parse_depth("0-5")
parse_depth("100-200")
parse_depth("30")


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