Learn R Programming

aqp (version 2.3.1)

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

2,462

Version

2.3.1

License

GPL (>= 3)

Maintainer

Dylan Beaudette

Last Published

March 20th, 2026

Functions in aqp (2.3.1)

alignTransect

Calculate Relative Positions from Transect Data
addDiagnosticBracket

Annotate Diagnostic Features
aggregateColor

Summarize Soil Colors
SoilTextureLevels

Ranking Systems for USDA Soil Texture Classes
addVolumeFraction

Symbolize Volume Fraction within a Soil Profile Collection Plot
addBracket

Add Depth Brackets
accumulateDepths

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

Probabilistic Estimation of Soil Depth within Groups
aggregateColorPlot

Plot aggregate soil color data
plotSPC

Create Soil Profile Sketches
barron.torrent.redness.LAB

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

Check a SoilProfileCollection object for errors in horizon depths.
ca630

Soil Data from the Central Sierra Nevada Region of California
bootstrapSoilTexture

Bootstrap Soil Texture Data
allocate

Allocate soil properties within various classification systems.
aqp_df_class,SoilProfileCollection-method

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

Multinominal Brier Score
buntley.westin.index

Buntley-Westin (1965) Index
argillic.clay.increase.depth

Return upper boundary of argillic horizon
aqp-package

Algorithms for Quantitative Pedology
col2Munsell

Convert colors into Munsell Notation
c,SoilProfileCollection-method

Combine SoilProfileCollection objects
collapseHz

Collapse Horizons within Profiles Based on Pattern Matching
colorVariation

Quantitative Description of Color Variation
colorContrastPlot

Color Contrast Plot
colorQuantiles

Soil Color Range via Quantiles
colorContrast

Metrics of Contrast Suitable for Comparing Soil Colors
as

Coerce SoilProfileCollection with as()
colorChart

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

Test for a valid SoilProfileCollection
compareSites

Compare Site Level Attributes of a SoilProfileCollection
contrastChart

Color Contrast Chart
correctAWC

Apply rock fragment or salt correction to available water content
confusionIndex

Confusion Index
depthOf

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

Return a list representation of site and horizon level data
depthWeights

Return a vector of contributing fractions over a depth interval
denormalize

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

Soil Color Contrast
crit.clay.argillic

Determines threshold (minimum) clay content for argillic upper bound
[[<-

Add or change column of horizon or site data in a SoilProfileCollection
[[

Get column of horizon or site data in a SoilProfileCollection
diagnostic_hz,SoilProfileCollection-method

Get or Set Diagnostic Horizon data in a SoilProfileCollection
dice,SoilProfileCollection-method

Efficient Slicing of SoilProfileCollection Objects
.colorSig2PerceptualDistMat

Interpret a color signature containing color groups of CIELAB coordinates using perceptual distance via CIE dE00
$<-

Set data in column of horizon or site data in a SoilProfileCollection
.detectColorSpec

Detect color specification from a vector of values, or a matrix of color coordinates
depths

Initialize a SoilProfileCollection from data.frame
depth_units,SoilProfileCollection-method

Get depth units from metadata
$

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

Label placement based on a simulation of electrostatic forces
estimatePSCS

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

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

Estimate available water capacity for fine-earth fraction
estimateSoilColor

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

Evaluate Generalized Horizon Labels
estimateSoilDepth

Estimate Soil Depth
evalMissingData

Evaluate Missing Data within a SoilProfileCollection
equivalent_munsell

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

Duplicate Profiles of a SoilProfileCollection
fixOverlap

Fix Overlap within a Sequence
fragmentClasses

Coarse Fragment Class Labels and Diameter
fillHzGaps

Find and Fill Horizon Gaps
flagOverlappingHz

Flag perfectly overlapping horizons within a SoilProfileCollection
fragmentSieve

Sieve the Coarse Fraction of Soil
get.increase.matrix

Compute Pair-wise Distances of Soil Properties over Depth
genSlabLabels

Generate Labels for Slabs
genhzTableToAdjMat

Convert cross-tabulation to adjacency matrix.
generalize.hz

Generalize Horizon Names
explainPlotSPC

Visual Explanation for plotSPC
get.ml.hz

Determine ML Horizon Boundaries
getArgillicBounds

Estimate upper and lower boundary of argillic diagnostic subsurface horizon
getSurfaceHorizonDepth

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

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

Subset soil horizon data using a depth or depth interval
getClosestMunsellChip

Get Approximate Munsell Chip
getCambicBounds

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

Generate Soil Depth Class Matrix
grepSPC

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

Subset an SPC by applying glom to each profile
horizonDepths<-

Set horizon depth column names
guessGenHzLevels

Guess Appropriate Ordering for Generalized Horizon Labels
groupSPC

Store groupings within a profile collection.
hasDarkColors

Find horizons with colors darker than a Munsell hue, value, chroma threshold
harden.rubification

Harden (1982) Rubification
horizonColorIndices

Horizon Color Indices
harden.melanization

Harden (1982) Melanization
harmonize,SoilProfileCollection-method

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

Guess Horizon Slot Column Names
groupedProfilePlot

Grouped Soil Profile Plot
hzMetadata,SoilProfileCollection-method

Get horizon-level metadata
huePositionCircle

Visual Description of Munsell Hue Ordering
hzDepthTests

Tests of horizon depth logic
huePosition

Munsell Hue Reference and Position Searching
hzDesgn,SoilProfileCollection-method

Get horizon designation column name
horizonNames<-

Set horizon column names
hzID<-,SoilProfileCollection-method

Set horizon IDs
horizons,SoilProfileCollection-method

Retrieve horizon data from SoilProfileCollection
hurst.redness

Hurst (1977) Redness Index
hzDistinctnessCodeToOffset

Convert Horizon Boundary Distinctness to Vertical Offset
hz_to_taxpartsize

Allocate Particle Size Class for the Control Section.
hzTransitionProbabilities

Horizon Transition Probabilities
hzAbove

Select Horizons Above or Below a Reference Horizon
hz_lag

Find lagged horizon values
hz_intersect

Intersecting horizon boundaries by horizon depths
hz_dissolve

Dissolving horizon boundaries by grouping variables
hzdesgnname

Get or Set Horizon Designation Column Name
hz_segment

Segmenting of Soil Horizon Data by Depth Interval
hzTopographyCodeToOffset

Convert Horizon Boundary Topography to Vertical Offset
hzTopographyCodeToLineType

Convert Horizon Boundary Topography to Line Type
length,SoilProfileCollection-method

Get the number of profiles in a SoilProfileCollection
invertLabelColor

Make High Contrast Label Colors
idname,SoilProfileCollection-method

Get profile ID column name
launderMunsell

Fix Common Errors in Munsell Notation
hzidname<-

Set horizon ID column name
jacobs2000

Soil Morphologic Data from Jacobs et al. 2002.
hzmetaname

Get or Set Horizon Metadata Column Name
isEmpty,SoilProfileCollection-method

Check for "empty" profiles in a SoilProfileCollection
hztexclname

Get or Set Horizon Texture Class Column Name
initSpatial<-,SoilProfileCollection,ANY,ANY-method

Initialize Spatial Data in a SoilProfileCollection
mu_confusion_matrix

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

Get the minimum bottom depth in a SoilProfileCollection
lookup_taxpartsize

Ranking Systems for USDA Taxonomic Particle-Size and Substitute Classes of Mineral Soils
max,SoilProfileCollection-method

Get the maximum bottom depth in a SoilProfileCollection
metadata,SoilProfileCollection-method

Retrieve metadata from SoilProfileCollection
munsell

Munsell to sRGB Lookup Table for Common Soil Colors
lunique

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

Mix Munsell Colors via Spectral Library
mollic.thickness.requirement

Calculate the minimum thickness requirement for Mollic epipedon
missingDataGrid

Missing Data Grid
osd

Example Output from soilDB::fetchOSD()
munsell2rgb

Convert Munsell Color Notation to other Color Space Coordinates (sRGB and CIELAB)
findOverlap

Find Overlap within a Sequence
nrow,SoilProfileCollection-method

Get the number of horizons in a SoilProfileCollection
munsell.spectra

Spectral Library of Munsell Colors
panel.depth_function

Lattice Panel Function for Soil Profiles
mutate_profile

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

Get names of columns in site and horizons table
munsellHuePosition

Munsell Hue Position Reference
munsell2spc,SoilProfileCollection-method

Merge Munsell Hue, Value, Chroma converted to sRGB & CIELAB into a SoilProfileCollection
perturb

Perturb soil horizon depths using boundary distinctness
previewColors

Preview Colors
parseMunsell

Parse Munsell Color Notation
profileApply

Iterate over profiles in a SoilProfileCollection
pbindlist

Combine a list of SoilProfileCollection objects
plotColorMixture

Visualize Spectral Mixing of Munsell Colors
plotProfileDendrogram

Plot soil profiles below a dendrogram or cladogram
plotColorQuantiles

Visualize Color Quantiles
plot_distance_graph

Between Individual Distance Plot
plotMultipleSPC

Plot Multiple SoilProfileCollection Objects
reactionclass

pH Reaction Classes
reorderHorizons

Re-order corrupted horizon data
reduceSPC

Select a subset of columns from a SoilProfileCollection
rebuildSPC

Rebuild a SoilProfileCollection object
ph_to_rxnclass

Convert pH to/from Reaction Classes
profileGroupLabels

Soil Profile Group Labels
quickSPC

Quickly Assemble a SoilProfileCollection
profile_id<-

Set profile IDs
profileInformationIndex

Soil Profile Information Index
random_profile

Random Profile
repairMissingHzDepths

Repair Problematic Lower Horizon Depths
rp

Generate a SoilProfileCollection of random profiles
shannonEntropy

Shannon Entropy
sierraTransect

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

sRGB to Munsell Color Conversion
replaceHorizons<-

Replace Data in Horizon Slot
restrictions,SoilProfileCollection-method

Get or Set Restriction data in a SoilProfileCollection
shuffle

Shuffle Horizons of a SoilProfileCollection
rowley2019

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

SoilProfileCollection show method
soilPalette

Soil Color Palette
[,SoilProfileCollection-method

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

Set site column names
simulateColor

Simulate Soil Colors
site,SoilProfileCollection-method

Retrieve site data from SoilProfileCollection
soilColorSignature

Soil Profile Color Signatures
slicedHSD

Tukey's HSD Over Slices
slab

Slab-Wise Aggregation of SoilProfileCollection Objects
sim

DEPRECATED Simulate Soil Profiles
slice-methods

Slicing of SoilProfileCollection Objects
sp5

Sample Soil Database #5
soilTextureColorPal

Soil Texture Color Palettes
spc2mpspline,SoilProfileCollection-method

SoilProfileCollection wrapper for mpspline2::mpspline()
sp3

Soil Profile Data Example 3
sp4

Soil Chemical Data from Serpentinitic Soils of California
sp1

Soil Profile Data Example 1
sp2

Honcut Creek Soil Profile Data
soil_minerals

Munsell Colors of Common Soil Minerals
sp6

Soil Physical and Chemical Data from Manganiferous Soils
soiltexture

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

Subset SPC based on result of performing function on each profile
summarizeSPC

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

Quickly assess relative state of site and horizon slots
subset,SoilProfileCollection-method

Subset a SoilProfileCollection with logical expressions
subsetHz,SoilProfileCollection-method

Subset the horizons in a SoilProfileCollection using logical criteria
splitLogicErrors

Split a SoilProfileCollection into a list based on types of horizon logic errors
split,SoilProfileCollection-method

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

Convert reflectance spectra to closest Munsell chip
subsetProfiles

DEPRECATED use subset
spectral.reference

Standard Illuminants and Observers
us.state.soils

US State Soils
textureTriangleSummary

Soil Texture Low-RV-High as Defined by Quantiles
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
validSpatialData,SoilProfileCollection-method

Check for valid spatial reference of profiles
thompson.bell.darkness

Thompson-Bell (1996) Index
thicknessOf

Calculate Thickness of Horizons Matching Logical Criteria
tauW

Compute weighted naive and tau statistics for a cross-classification matrix
texcl_to_ssc

Textural conversions
traditionalColorNames

Traditional Soil Color Names
validateMunsell

Validate Standard Munsell Notation
warpHorizons

Inflate / Deflate Horizon Thickness
wilson2022

Example Data from Wilson et al. 2022
xtableTauW

Format a LaTeX table with results