Learn R Programming

aqp (version 2.3)

Algorithms for Quantitative Pedology

Description

The Algorithms for Quantitative Pedology (AQP) project was started in 2009 to organize a loosely-related set of concepts and source code on the topic of soil profile visualization, aggregation, and classification into this package (aqp). Over the past 8 years, the project has grown into a suite of related R packages that enhance and simplify the quantitative analysis of soil profile data. Central to the AQP project is a new vocabulary of specialized functions and data structures that can accommodate the inherent complexity of soil profile information; freeing the scientist to focus on ideas rather than boilerplate data processing tasks . These functions and data structures have been extensively tested and documented, applied to projects involving hundreds of thousands of soil profiles, and deeply integrated into widely used tools such as SoilWeb . Components of the AQP project (aqp, soilDB, sharpshootR, soilReports packages) serve an important role in routine data analysis within the USDA-NRCS Soil Science Division. The AQP suite of R packages offer a convenient platform for bridging the gap between pedometric theory and practice.

Copy Link

Version

Install

install.packages('aqp')

Monthly Downloads

3,409

Version

2.3

License

GPL (>= 3)

Maintainer

Dylan Beaudette

Last Published

January 17th, 2026

Functions in aqp (2.3)

SPC.with.overlap

Example SoilProfileCollection with Overlapping Horizons
L1_profiles

Create Representative Soil Profiles via L1 Estimator
prj,SoilProfileCollection-method

Get or Set Coordinate Reference System for SoilProfileCollection
GHL

Get or Set Generalized Horizon Label (GHL) Column Name
plotSPC

Create Soil Profile Sketches
NCSP

Numerical Classification of Soil Profiles
SoilTextureLevels

Ranking Systems for USDA Soil Texture Classes
alignTransect

Calculate Relative Positions from Transect Data
addBracket

Add Depth Brackets
aggregateColor

Summarize Soil Colors
addVolumeFraction

Symbolize Volume Fraction within a Soil Profile Collection Plot
accumulateDepths

Accumulate horizon depths, and reflect reversed depths, relative to new datum
aggregateSoilDepth

Probabilistic Estimation of Soil Depth within Groups
allocate

Allocate soil properties within various classification systems.
aggregateColorPlot

Plot aggregate soil color data
addDiagnosticBracket

Annotate Diagnostic Features
checkHzDepthLogic

Check a SoilProfileCollection object for errors in horizon depths.
aqp-package

Algorithms for Quantitative Pedology
bootstrapSoilTexture

Bootstrap Soil Texture Data
argillic.clay.increase.depth

Return upper boundary of argillic horizon
aqp_df_class,SoilProfileCollection-method

Get aqp_df_class entry from metadata or return a safe value.
checkSPC

Test for a valid SoilProfileCollection
colorContrastPlot

Color Contrast Plot
as

Coerce SoilProfileCollection with as()
col2Munsell

Convert colors into Munsell Notation
brierScore

Multinominal Brier Score
compareSites

Compare Site Level Attributes of a SoilProfileCollection
c,SoilProfileCollection-method

Combine SoilProfileCollection objects
colorContrast

Metrics of Contrast Suitable for Comparing Soil Colors
barron.torrent.redness.LAB

Barron & Torrent (1986) Redness Index in LAB color space
colorChart

Visualize soil colors in Munsell notation according to within-group frequency.
collapseHz

Collapse Horizons within Profiles Based on Pattern Matching
colorQuantiles

Soil Color Range via Quantiles
colorVariation

Quantitative Description of Color Variation
ca630

Soil Data from the Central Sierra Nevada Region of California
depth_units,SoilProfileCollection-method

Get depth units from metadata
depthWeights

Return a vector of contributing fractions over a depth interval
buntley.westin.index

Buntley-Westin (1965) Index
contrastClass

Soil Color Contrast
denormalize

Create a (redundant) horizon-level attribute from a site-level attribute
contrastChart

Color Contrast Chart
dice,SoilProfileCollection-method

Efficient Slicing of SoilProfileCollection Objects
$<-

Set data in column of horizon or site data in a SoilProfileCollection
correctAWC

Apply rock fragment or salt correction to available water content
crit.clay.argillic

Determines threshold (minimum) clay content for argillic upper bound
estimateSoilColor

Estimate dry soil colors from moist soil colors and vice versa.
.colorSig2PerceptualDistMat

Interpret a color signature containing color groups of CIELAB coordinates using perceptual distance via CIE dE00
evalGenHZ

Evaluate Generalized Horizon Labels
$

Get data from column of horizon or site data in a SoilProfileCollection
depthOf

Get top or bottom depths of horizons matching a regular expression pattern
estimateSoilDepth

Estimate Soil Depth
estimatePSCS

Estimate boundaries of the U.S Soil Taxonomy Particle Size Control Section
[[

Get column of horizon or site data in a SoilProfileCollection
duplicate

Duplicate Profiles of a SoilProfileCollection
equivalent_munsell

Indices of "equivalent" Munsell chips in the munsell data set
estimateAWC

Estimate available water capacity for fine-earth fraction
depths

Initialize a SoilProfileCollection from data.frame
fragmentSieve

Sieve the Coarse Fraction of Soil
fillHzGaps

Find and Fill Horizon Gaps
fixOverlap

Fix Overlap within a Sequence
genSlabLabels

Generate Labels for Slabs
get.increase.matrix

Compute Pair-wise Distances of Soil Properties over Depth
compositeSPC

Return a list representation of site and horizon level data
equivalentMunsellChips

Identify "equivalent" (whole number value/chroma) Munsell chips
fragmentClasses

Coarse Fragment Class Labels and Diameter
confusionIndex

Confusion Index
flagOverlappingHz

Flag perfectly overlapping horizons within a SoilProfileCollection
electroStatics_1D

Label placement based on a simulation of electrostatic forces
.detectColorSpec

Detect color specification from a vector of values, or a matrix of color coordinates
[[<-

Add or change column of horizon or site data in a SoilProfileCollection
get.ml.hz

Determine ML Horizon Boundaries
getArgillicBounds

Estimate upper and lower boundary of argillic diagnostic subsurface horizon
getCambicBounds

Find all intervals that are potentially part of a Cambic horizon
getClosestMunsellChip

Get Approximate Munsell Chip
getLastHorizonID

Get IDs of Deepest Horizons by Profile
glom,SoilProfileCollection-method

Subset soil horizon data using a depth or depth interval
groupedProfilePlot

Grouped Soil Profile Plot
glomApply

Subset an SPC by applying glom to each profile
grepSPC

Subset SPC with pattern-matching for text-based attributes
guessHzAttrName

Guess Horizon Slot Column Names
groupSPC

Store groupings within a profile collection.
harden.melanization

Harden (1982) Melanization
guessGenHzLevels

Guess Appropriate Ordering for Generalized Horizon Labels
explainPlotSPC

Visual Explanation for plotSPC
genhzTableToAdjMat

Convert cross-tabulation to adjacency matrix.
diagnostic_hz,SoilProfileCollection-method

Get or Set Diagnostic Horizon data in a SoilProfileCollection
generalize.hz

Generalize Horizon Names
getSoilDepthClass

Generate Soil Depth Class Matrix
evalMissingData

Evaluate Missing Data within a SoilProfileCollection
hurst.redness

Hurst (1977) Redness Index
huePositionCircle

Visual Description of Munsell Hue Ordering
horizonDepths<-

Set horizon depth column names
hzDesgn,SoilProfileCollection-method

Get horizon designation column name
getSurfaceHorizonDepth

Determine thickness of horizons (continuous from surface) matching a pattern
hzTransitionProbabilities

Horizon Transition Probabilities
harden.rubification

Harden (1982) Rubification
hzDepthTests

Tests of horizon depth logic
harmonize,SoilProfileCollection-method

Harmonize a property by profile-level denormalization for convenient visualization or analysis of ranges
hzdesgnname

Get or Set Horizon Designation Column Name
hzID<-,SoilProfileCollection-method

Set horizon IDs
hzDistinctnessCodeToOffset

Convert Horizon Boundary Distinctness to Vertical Offset
horizonNames<-

Set horizon column names
hzTopographyCodeToLineType

Convert Horizon Boundary Topography to Line Type
hz_segment

Segmenting of Soil Horizon Data by Depth Interval
lunique

Eliminate duplicate instances of profile IDs in a list of SoilProfileCollections
hzTopographyCodeToOffset

Convert Horizon Boundary Topography to Vertical Offset
lookup_taxpartsize

Ranking Systems for USDA Taxonomic Particle-Size and Substitute Classes of Mineral Soils
hz_to_taxpartsize

Allocate Particle Size Class for the Control Section.
metadata,SoilProfileCollection-method

Retrieve metadata from SoilProfileCollection
max,SoilProfileCollection-method

Get the maximum bottom depth in a SoilProfileCollection
hzidname<-

Set horizon ID column name
munsell.spectra

Spectral Library of Munsell Colors
hzmetaname

Get or Set Horizon Metadata Column Name
hztexclname

Get or Set Horizon Texture Class Column Name
hz_dissolve

Dissolving horizon boundaries by grouping variables
munsell2rgb

Convert Munsell Color Notation to other Color Space Coordinates (sRGB and CIELAB)
min,SoilProfileCollection-method

Get the minimum bottom depth in a SoilProfileCollection
nrow,SoilProfileCollection-method

Get the number of horizons in a SoilProfileCollection
missingDataGrid

Missing Data Grid
pbindlist

Combine a list of SoilProfileCollection objects
parseMunsell

Parse Munsell Color Notation
horizons,SoilProfileCollection-method

Retrieve horizon data from SoilProfileCollection
hasDarkColors

Find horizons with colors darker than a Munsell hue, value, chroma threshold
horizonColorIndices

Horizon Color Indices
findOverlap

Find Overlap within a Sequence
panel.depth_function

Lattice Panel Function for Soil Profiles
osd

Example Output from soilDB::fetchOSD()
plotColorQuantiles

Visualize Color Quantiles
initSpatial<-

Initialize Spatial Data in a SoilProfileCollection
hzAbove

Horizons Above or Below
mu_confusion_matrix

Map unit confusion matrix and other classification measures
idname,SoilProfileCollection-method

Get profile ID column name
hzMetadata,SoilProfileCollection-method

Get horizon-level metadata
hz_lag

Find lagged horizon values
hz_intersect

Intersecting horizon boundaries by horizon depths
plotColorMixture

Visualize Spectral Mixing of Munsell Colors
perturb

Perturb soil horizon depths using boundary distinctness
munsell

Munsell to sRGB Lookup Table for Common Soil Colors
plotMultipleSPC

Plot Multiple SoilProfileCollection Objects
profileInformationIndex

Soil Profile Information Index
replaceHorizons<-

Replace Data in Horizon Slot
profileGroupLabels

Soil Profile Group Labels
repairMissingHzDepths

Repair Problematic Lower Horizon Depths
mutate_profile

Transform a SPC (by profile) with a set of expressions
munsell2spc,SoilProfileCollection-method

Merge Munsell Hue, Value, Chroma converted to sRGB & CIELAB into a SoilProfileCollection
length,SoilProfileCollection-method

Get the number of profiles in a SoilProfileCollection
jacobs2000

Soil Morphologic Data from Jacobs et al. 2002.
plotProfileDendrogram

Plot soil profiles below a dendrogram or cladogram
restrictions,SoilProfileCollection-method

Get or Set Restriction data in a SoilProfileCollection
rgb2munsell

sRGB to Munsell Color Conversion
ph_to_rxnclass

Convert pH to/from Reaction Classes
sim

DEPRECATED Simulate Soil Profiles
munsellHuePosition

Munsell Hue Position Reference
random_profile

Random Profile
rebuildSPC

Rebuild a SoilProfileCollection object
soilColorSignature

Soil Profile Color Signatures
reactionclass

pH Reaction Classes
soilPalette

Soil Color Palette
names,SoilProfileCollection-method

Get names of columns in site and horizons table
[,SoilProfileCollection-method

Matrix/data.frame-like access to profiles and horizons in a SoilProfileCollection
profile_id<-

Set profile IDs
profileApply

Iterate over profiles in a SoilProfileCollection
site,SoilProfileCollection-method

Retrieve site data from SoilProfileCollection
previewColors

Preview Colors
quickSPC

Quickly Assemble a SoilProfileCollection
sp6

Soil Physical and Chemical Data from Manganiferous Soils
siteNames<-

Set site column names
simulateColor

Simulate Soil Colors
invertLabelColor

Make High Contrast Label Colors
sp4

Soil Chemical Data from Serpentinitic Soils of California
sp5

Sample Soil Database #5
huePosition

Munsell Hue Reference and Position Searching
soiltexture

Lookup tables for sand, silt, clay, texture class, and textural modifiers.
sp1

Soil Profile Data Example 1
slab

Slab-Wise Aggregation of SoilProfileCollection Objects
isEmpty,SoilProfileCollection-method

Check for "empty" profiles in a SoilProfileCollection
tauW

Compute weighted naive and tau statistics for a cross-classification matrix
spc2mpspline,SoilProfileCollection-method

SoilProfileCollection wrapper for mpspline2::mpspline()
sierraTransect

Soil Physical and Chemical Data Related to Studies in the Sierra Nevada Mountains, CA, USA.
soilTextureColorPal

Soil Texture Color Palettes
shuffle

Shuffle Horizons of a SoilProfileCollection
mollic.thickness.requirement

Calculate the minimum thickness requirement for Mollic epipedon
rowley2019

Soil Morphologic, Geochemical, and Mineralogy Data from Rowley et al. 2019.
mixMunsell

Mix Munsell Colors via Spectral Library
rp

Generate a SoilProfileCollection of random profiles
slice-methods

Slicing of SoilProfileCollection Objects
validSpatialData,SoilProfileCollection-method

Check for valid spatial reference of profiles
us.state.soils

US State Soils
slicedHSD

Tukey's HSD Over Slices
texcl_to_ssc

Textural conversions
sp2

Honcut Creek Soil Profile Data
sp3

Soil Profile Data Example 3
subApply

Subset SPC based on result of performing function on each profile
transform,SoilProfileCollection-method

Transform a SPC with expressions based on site or horizon level attributes
unique,SoilProfileCollection-method

Uniqueness within a SoilProfileCollection via MD5 Hash
splitLogicErrors

Split a SoilProfileCollection into a list based on types of horizon logic errors
spectral.reference

Standard Illuminants and Observers
reduceSPC

Select a subset of columns from a SoilProfileCollection
reorderHorizons

Re-order corrupted horizon data
plot_distance_graph

Between Individual Distance Plot
subsetHz,SoilProfileCollection-method

Subset the horizons in a SoilProfileCollection using logical criteria
soil_minerals

Munsell Colors of Common Soil Minerals
subset,SoilProfileCollection-method

Subset a SoilProfileCollection with logical expressions
spc_in_sync

Quickly assess relative state of site and horizon slots
shannonEntropy

Shannon Entropy
show

SoilProfileCollection show method
split,SoilProfileCollection-method

Split a SoilProfileCollection object into a list of SoilProfileCollection objects.
thicknessOf

Calculate Thickness of Horizons Matching Logical Criteria
textureTriangleSummary

Soil Texture Low-RV-High as Defined by Quantiles
thompson.bell.darkness

Thompson-Bell (1996) Index
spec2Munsell

Convert reflectance spectra to closest Munsell chip
xtableTauW

Format a LaTeX table with results
traditionalColorNames

Traditional Soil Color Names
subsetProfiles

DEPRECATED use subset
summarizeSPC

Perform summaries on groups (from group_by) and create new site or horizon level attributes
warpHorizons

Inflate / Deflate Horizon Thickness
wilson2022

Example Data from Wilson et al. 2022
ROSETTA.centroids

Average Hydraulic Parameters from the ROSETTA Model by USDA Soil Texture Class
HzDepthLogicSubset

Subset SoilProfileCollection Objects or Horizons via checkHzDepthLogic
SoilProfileCollection

An S4 object representation of a group of soil profiles.
SANN_1D

Fix Overlap within a Sequence via Simulated Annealing