Learn R Programming

aqp (version 2.2)

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

1,994

Version

2.2

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Dylan Beaudette

Last Published

February 15th, 2025

Functions in aqp (2.2)

SoilProfileCollection

An S4 object representation of a group of soil profiles.
prj,SoilProfileCollection-method

Get or Set Coordinate Reference System for SoilProfileCollection
L1_profiles

Create Representative Soil Profiles via L1 Estimator
GHL

Get or Set Generalized Horizon Label (GHL) Column Name
SPC.with.overlap

Example SoilProfileCollection with Overlapping Horizons
plotSPC

Create Soil Profile Sketches
SANN_1D

Fix Overlap within a Sequence via Simulated Annealing
NCSP

Numerical Classification of Soil Profiles
HzDepthLogicSubset

Subset SoilProfileCollection Objects or Horizons via checkHzDepthLogic
ROSETTA.centroids

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

Symbolize Volume Fraction within a Soil Profile Collection Plot
aggregateSoilDepth

Probabilistic Estimation of Soil Depth within Groups
accumulateDepths

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

Add Depth Brackets
addDiagnosticBracket

Annotate Diagnostic Features
aggregateColorPlot

Plot aggregate soil color data
SoilTextureLevels

Ranking Systems for USDA Soil Texture Classes
alignTransect

Calculate Relative Positions from Transect Data
aggregateColor

Summarize Soil Colors
allocate

Allocate soil properties within various classification systems.
bootstrapSoilTexture

Bootstrap Soil Texture Data
checkHzDepthLogic

Check a SoilProfileCollection object for errors in horizon depths.
argillic.clay.increase.depth

Return upper boundary of argillic horizon
checkSPC

Test for a valid SoilProfileCollection
brierScore

Multinominal Brier Score
buntley.westin.index

Buntley-Westin (1965) Index
ca630

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

Get aqp_df_class entry from metadata or return a safe value.
aqp-package

Algorithms for Quantitative Pedology
col2Munsell

Convert colors into Munsell Notation
as

Coerce SoilProfileCollection with as()
barron.torrent.redness.LAB

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

Soil Color Range via Quantiles
c,SoilProfileCollection-method

Combine SoilProfileCollection objects
compareSites

Compare Site Level Attributes of a SoilProfileCollection
compositeSPC

Return a list representation of site and horizon level data
collapseHz

Collapse Horizons within Profiles Based on Pattern Matching
colorChart

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

Metrics of Contrast Suitable for Comparing Soil Colors
depthOf

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

Color Contrast Plot
confusionIndex

Confusion Index
contrastChart

Color Contrast Chart
crit.clay.argillic

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

Return a vector of contributing fractions over a depth interval
duplicate

Duplicate Profiles of a SoilProfileCollection
denormalize

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

Label placement based on a simulation of electrostatic forces
$<-

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

Apply rock fragment or salt correction to available water content
$

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

Soil Color Contrast
diagnostic_hz,SoilProfileCollection-method

Get or Set Diagnostic Horizon data in a SoilProfileCollection
[[<-

Add or change column of horizon or site data in a SoilProfileCollection
dice,SoilProfileCollection-method

Efficient Slicing of SoilProfileCollection Objects
[[

Get column of horizon or site data in a SoilProfileCollection
equivalentMunsellChips

Identify "equivalent" (whole number value/chroma) Munsell chips
depth_units,SoilProfileCollection-method

Get depth units from metadata
depths

Initialize a SoilProfileCollection from data.frame
estimateSoilDepth

Estimate Soil Depth
estimateAWC

Estimate available water capacity for fine-earth fraction
estimateSoilColor

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

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

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

Visual Explanation for plotSPC
fillHzGaps

Find and Fill Horizon Gaps
fixOverlap

Fix Overlap within a Sequence
flagOverlappingHz

Flag perfectly overlapping horizons within a SoilProfileCollection
evalGenHZ

Evaluate Generalized Horizon Labels
evalMissingData

Evaluate Missing Data within a SoilProfileCollection
genSlabLabels

Generate Labels for Slabs
fragmentSieve

Sieve the Coarse Fraction of Soil
fragmentClasses

Coarse Fragment Class Labels and Diameter
generalize.hz

Generalize Horizon Names
getArgillicBounds

Estimate upper and lower boundary of argillic diagnostic subsurface horizon
get.ml.hz

Determine ML Horizon Boundaries
grepSPC

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

Get Approximate Munsell Chip
glomApply

Subset an SPC by applying glom to each profile
getCambicBounds

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

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

Get IDs of Deepest Horizons by Profile
genhzTableToAdjMat

Convert cross-tabulation to adjacency matrix.
get.increase.matrix

Compute Pair-wise Distances of Soil Properties over Depth
guessHzAttrName

Guess Horizon Slot Column Names
groupSPC

Store groupings within a profile collection.
glom,SoilProfileCollection-method

Subset soil horizon data using a depth or depth interval
guessGenHzLevels

Guess Appropriate Ordering for Generalized Horizon Labels
groupedProfilePlot

Grouped Soil Profile Plot
horizonNames<-

Set horizon column names
getSoilDepthClass

Generate Soil Depth Class Matrix
huePosition

Munsell Hue Reference and Position Searching
horizons,SoilProfileCollection-method

Retrieve horizon data from SoilProfileCollection
harmonize,SoilProfileCollection-method

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

Find horizons with colors darker than a Munsell hue, value, chroma threshold
hurst.redness

Hurst (1977) Redness Index
hzDepthTests

Tests of horizon depth logic
hzMetadata,SoilProfileCollection-method

Get horizon-level metadata
hzID<-,SoilProfileCollection-method

Set horizon IDs
horizonColorIndices

Horizon Color Indices
horizonDepths<-

Set horizon depth column names
idname,SoilProfileCollection-method

Get profile ID column name
hztexclname

Get or Set Horizon Texture Class Column Name
hzdesgnname

Get or Set Horizon Designation Column Name
hzTopographyCodeToLineType

Convert Horizon Boundary Topography to Line Type
huePositionCircle

Visual Description of Munsell Hue Ordering
hzAbove

Horizons Above or Below
hz_to_taxpartsize

Allocate Particle Size Class for the Control Section.
hzTransitionProbabilities

Horizon Transition Probabilities
hz_lag

Find lagged horizon values
hz_segment

Segmenting of Soil Horizon Data by Depth Interval
hzTopographyCodeToOffset

Convert Horizon Boundary Topography to Vertical Offset
hzDesgn,SoilProfileCollection-method

Get horizon designation column name
harden.melanization

Harden (1982) Melanization
harden.rubification

Harden (1982) Rubification
initSpatial<-

Initialize Spatial Data in a SoilProfileCollection
hzDistinctnessCodeToOffset

Convert Horizon Boundary Distinctness to Vertical Offset
hz_dissolve

Dissolving horizon boundaries by grouping variables
hz_intersect

Intersecting horizon boundaries by horizon depths
length,SoilProfileCollection-method

Get the number of profiles in a SoilProfileCollection
lookup_taxpartsize

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

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

Retrieve metadata from SoilProfileCollection
munsell2spc,SoilProfileCollection-method

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

Missing Data Grid
lunique

Eliminate duplicate instances of profile IDs in a list of SoilProfileCollections
max,SoilProfileCollection-method

Get the maximum bottom depth in a SoilProfileCollection
hzmetaname

Get or Set Horizon Metadata Column Name
jacobs2000

Soil Morphologic Data from Jacobs et al. 2002.
isEmpty,SoilProfileCollection-method

Check for "empty" profiles in a SoilProfileCollection
hzidname<-

Set horizon ID column name
mutate_profile

Transform a SPC (by profile) with a set of expressions
munsell.spectra

Spectral Library of Munsell Colors
invertLabelColor

Make High Contrast Label Colors
munsell2rgb

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

Get names of columns in site and horizons table
mixMunsell

Mix Munsell Colors via Spectral Library
osd

Example Output from soilDB::fetchOSD()
nrow,SoilProfileCollection-method

Get the number of horizons in a SoilProfileCollection
findOverlap

Find Overlap within a Sequence
panel.depth_function

Lattice Panel Function for Soil Profiles
munsellHuePosition

Munsell Hue Position Reference
plotMultipleSPC

Plot Multiple SoilProfileCollection Objects
mollic.thickness.requirement

Calculate the minimum thickness requirement for Mollic epipedon
plotColorQuantiles

Visualize Color Quantiles
munsell

Munsell to sRGB Lookup Table for Common Soil Colors
pbindlist

Combine a list of SoilProfileCollection objects
parseMunsell

Parse Munsell Color Notation
plotColorMixture

Visualize Spectral Mixing of Munsell Colors
perturb

Perturb soil horizon depths using boundary distinctness
previewColors

Preview Colors
profileGroupLabels

Soil Profile Group Labels
random_profile

Random Profile
ph_to_rxnclass

Convert pH to/from Reaction Classes
profile_id<-

Set profile IDs
profileApply

Iterate over profiles in a SoilProfileCollection
restrictions,SoilProfileCollection-method

Get or Set Restriction data in a SoilProfileCollection
plot_distance_graph

Between Individual Distance Plot
plotProfileDendrogram

Plot soil profiles below a dendrogram
rebuildSPC

Rebuild a SoilProfileCollection object
rgb2munsell

sRGB to Munsell Color Conversion
quickSPC

Quickly Assemble a SoilProfileCollection
profileInformationIndex

Soil Profile Information Index
repairMissingHzDepths

Repair Problematic Lower Horizon Depths
reorderHorizons

Re-order corrupted horizon data
reduceSPC

Select a subset of columns from a SoilProfileCollection
replaceHorizons<-

Replace Data in Horizon Slot
reactionclass

pH Reaction Classes
sim

DEPRECATED Simulate Soil Profiles
shannonEntropy

Shannon Entropy
[,SoilProfileCollection-method

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

Set site column names
rowley2019

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

SoilProfileCollection show method
simulateColor

Simulate Soil Colors
slab

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

Retrieve site data from SoilProfileCollection
slice-methods

Slicing of SoilProfileCollection Objects
slicedHSD

Tukey's HSD Over Slices
sp5

Sample Soil Database #5
sp4

Soil Chemical Data from Serpentinitic Soils of California
sp3

Soil Profile Data Example 3
sp2

Honcut Creek Soil Profile Data
soiltexture

Lookup tables for sand, silt, clay, texture class, and textural modifiers.
subset,SoilProfileCollection-method

Subset a SoilProfileCollection with logical expressions
soilColorSignature

Soil Profile Color Signatures
spc_in_sync

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

Subset the horizons in a SoilProfileCollection using logical criteria
sierraTransect

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

Soil Color Palette
spectral.reference

Standard Illuminants and Observers
sp1

Soil Profile Data Example 1
split,SoilProfileCollection-method

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

Soil Texture Color Palettes
splitLogicErrors

Split a SoilProfileCollection into a list based on types of horizon logic errors
soil_minerals

Munsell Colors of Common Soil Minerals
sp6

Soil Physical and Chemical Data from Manganiferous Soils
subApply

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

Convert reflectance spectra to closest Munsell chip
spc2mpspline,SoilProfileCollection-method

SoilProfileCollection wrapper for mpspline2::mpspline()
thompson.bell.darkness

Thompson-Bell (1996) Index
subsetProfiles

DEPRECATED use subset
transform,SoilProfileCollection-method

Transform a SPC with expressions based on site or horizon level attributes
tauW

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

Textural conversions
unique,SoilProfileCollection-method

Uniqueness within a SoilProfileCollection via MD5 Hash
unroll

Unroll Genetic Horizons
warpHorizons

Inflate / Deflate Horizon Thickness
thicknessOf

Calculate Thickness of Horizons Matching Logical Criteria
validSpatialData,SoilProfileCollection-method

Check for valid spatial reference of profiles
textureTriangleSummary

Soil Texture Low-RV-High as Defined by Quantiles
us.state.soils

US State Soils
wilson2022

Example Data from Wilson et al. 2022
xtableTauW

Format a LaTeX table with results
traditionalColorNames

Traditional Soil Color Names
summarizeSPC

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