knitr::opts_chunk$set( message = FALSE, warning = FALSE, background = '#F7F7F7', fig.align = 'center', dev = 'png', dpi = as.integer(Sys.getenv("R_AQP_VIGNETTE_IMAGE_DPI", unset = 32)), optipng = knitr::hook_optipng, comment = "#>" ) # keep examples from using more than 2 cores data.table::setDTthreads(Sys.getenv("OMP_THREAD_LIMIT", unset = 2)) options(width = 100, stringsAsFactors = FALSE, timeout = 600)
Soil morphology, observed properties, and geomorphic context represent a complex package of interrelated information that can be difficult to analyze and communicate as a whole. Graphical methods such as soil profile sketches and cross-sections represent a few of the possible methods commonly used to report on these kind of data. The Algorithms for Quantitative Pedology (AQP) project encompasses several related R packages tailored to this style of work. A specialized data structure (SoilProfileCollection) maintains linkages between soil horizons, diagnostic features, above-ground data, and geomorphic context. SoilProfileCollection objects can be filtered, subset, resampled (over new depth intervals), and re-ordered; all while preserving links to above and below-ground, linked data. Functions are provided for the conversion of soil colors to and from Munsell notation and several other color space coordinates. Graphical methods for the SoilProfileCollection provide a simple but flexible framework for the design and layout of soil profile sketches, aligned to x and or y axes defined by linked data.
depths(): init an SPC from data.framesite(): set or add site-level attributes of an SPC quickSPC(): quickly build an SPC from simple text templatesrandom_profile(): generate random SPC from suite of depth functionshzdesgnname(): get/set column containing horizon designationshzDesgn(): get vector of horizon designationshztexclname(): get/set column containing horizon texture classmetadata(): get/set SPC metadata (list)hzID(): get vector of horizon IDshzidname(): get/set column containing horizon IDshorizonDepths() get/set columns containing horizon top and bottom depthslength(): number of profiles in a SPCnrow(): number of horizons in a SPCnames(): list of horizon and site namessiteNames(): site-level column nameshorizonNames(): horizon-level column namesglom(): extract horizons based on overlap criteria defined by point or intervaltrunc(): truncate SPC to given depth intervalsubset(): subset profiles based on logical expressionssubsetHz(): subset horizons based on logical expressions[: data.frame-like subsetting of profiles (i-index) and/or horizons (j-index)[[: access site or horizon-level columns by namek-index expressions: .FIRST, .LAST, .HZID, .NHZmin(): minimum bottom depth within a SPCmax(): maximum bottom depth within a SPCdepthOf(): generalized "depth to" based on REGEX matchingminDepthOf(): special case of depthOf()maxDepthOf(): special case of depthOf()getSoilDepthClass(): estimate soil depth based on REGEX matching applied to horizon designation and associated depth classaggregateSoilDepth(): statistical estimation of soil depth (REGEX matching of horizon designation) within groups of profilescombine(), c(): combine multiple SPCs into a single SPCduplicate(): duplicate profiles within a SPCperturb(): randomly adjust horizon thickness or depths to simulate from a template SPCwarpHorizons(): expand / contract horizon thicknessharmonize(): create new profiles within a SPC based sets of related horizon-level datahzAbove(), hzBelow(): locate horizons above or below some criteriaunique(): determine uniqueness among profiles of an SPC via MD5 hashsplit(): split SPC into list of SPCs based on grouping factorsite(): get site data as data.framehorizons(): get horizon data as data.framereplaceHorizons(): replace horizon datadiagnostic_hz(): get/set diagnostic featuresrestrictions(): get/set restrictionsdenormalize(): convert site-level data into horizon-level data via replicationcompositeSPC(): downgrade an SPC to list of site and horizon-level dataprofileApply(): apply a function to each profile within an SPC (slow but simple interface)summarizeSPC(): perform group-wise summaries over profiles within an SPCtransform(): modify a SPC using expressions that operation on site or horizon-level datadice(): convert SPC to 1 depth-unit intervals by replicationslab(): apply an aggregate function over groups within a "dice()-ed" SPCspc2mpspline(): interface to equal-area spline fitting from mpspline2 packagesegment(): generate segment labels for depth-weighted aggregation L1_profiles(): create representative profiles via multivariate median (L1 estimator)slicedHSD(): apply Tukey's HSD over groups within a "dice()-ed" SPCaccumulateDepths(): fix horizon depths when old-style O horizon notation has been usedfillHzGaps(): fill topological gaps in horizon depthrepairMissingHzDepths(): attempt fixing missing or duplicated horizon bottom depthsflagOverlappingHz(): flag horizons with perfect overlapcheckHzDepthLogic(): apply battery of horizon depth topological testssplitLogicErrors(): split an SPC according to variety of possibly horizon depth errorsHzDepthLogicSubset(): remove profiles from an SPC if any depth logic errors are presentevalMissingData(): report metrics of missing data by profile within SPCmissingDataGrid(): visual indication of missing dataprofileInformationIndex(): experimental indices of "information content" by profileas(SPC, 'list'): convert SPC to listas(SPC, 'data.frame'): convert site and horizon data to data.frameas(SPC, 'sf'): convert site and spatial data to sf objectprj(): get/set coordinate reference system (CRS) metadatainitSpatial(): set (site-level) column names containing coordinatesgetSpatial(): get spatial data (site + coordinates) from an SPCcheckSPC(): check SPC for internal consistency rebuildSPC(): re-make an SPC from a previous version of aqp (rarely required)plotSPC(): create sketches of soil profiles from an SPCexplainPlotSPC(): explain various elements of a soil profile sketchgroupedProfilePlot(): create grouped sketches of soil profilesplotMultipleSPC(): create sketches from multiple, possibly non-conformal SPCsaddBracket(): add vertical brackets beside soil profile sketchesaddDiagnosticBracket(): add vertical brackets beside soil profile sketches based on diagnostic featuresaddVolumeFraction(): add visual explanation of coarse fragment volume to soil profile sketchesalignTransect(): align soil profiles to an external gradient such as topographic sequencecol2Munsell(): convert various color notations to Munsell notationmunsell2rgb(): convert Munsell notation to sRGB or CIELAB color coordinatesparseMunsell(): parse and optionally convert a munsell colorspec2Munsell(): estimate the closest Munsell color given reflectance spectra in the visible range getClosestMunsellChip(): estimate a reasonably close Munsell color given non-standard notation estimateSoilColor(): estimate moist soil color from dry soil color (and vice versa) colorContrast(): pair-wise color contrast and CIE2000 (dE00) based on colors in Munsell notation colorContrastPlot(): visual explanation of soil color contrast and dE00contrastChart(): Munsell color book style explanation of soil color contrast and dE00soilColorSignature(): derive soil color signatures for profiles within an SPCcolorChart(): Munsell color book representation of color frequencyaggregateColor(): estimate color proportions within an SPC according within groups of horizonscolorQuantiles(): marginal and L1 quantiles of color in CIELAB coordinateshuePosition(): generate an ordered factor of the standard Munsell hueshuePositionCircle(): graphical representation of the standard Munsell hues, with optional simulation of common color vision deficiencysimulateColor(): simulate a range of Munsell colors given measures of central tendency and spreadpreviewColors(): graphical preview of colors as a grid or via nMDSsoilPalette(): generate swatch-like arrangements of colors and labelsequivalentMunsellChips(): for a specified Munsell color, identify other Munsell colors with a very lower CIE2000 color contrast differencemixMunsell(): simulate an subtractive mixture of pigments specified in Munsell notation plotColorMixture(): simulate a subtractive mixture of pigments, display reflectance spectraNCSP(): numerical classification of soil profiles, within a SoilProfileCollectioncompareSites(): pair-wise comparison of site-level data from a SoilProfileCollectionallocate(): perform one of several classification systems to soil property dataestimateAWC(): estimate plant-available water holding capacitycorrectAWC(): apply rock fragment or soluble salt corrections to AWC estimateshzDistinctnessCodeToOffset(): convert horizon boundary distinctness codes to vertical offsethzTopographyCodeToLineType(): convert horizon boundary topography codes to line typeshzTopographyCodeToOffset(): convert horizon boundary topography codes to offsetph_to_rxnclass(): convert pH to reaction classrxnclass_to_ph(): convert reaction class to pH rangeReactionClassLevels(): ordered factor of reaction classeshorizonColorIndices(): compute various soil color-based indices to horizons within an SPC textureTriangleSummary(): graphical summary of sand, silt, clay fractions on a soil texture triangle bootstrapSoilTexture(): simulation of realistic compositions (sand, silt, clay) from a small set of example dataSoilTextureLevels(): ordered factor of soil texture classestexcl_to_ssc(): convert soil texture classes to sand, silt, clay centroidsssc_to_texcl(): convert sand, silt, clay values to soil texture classtexture_to_taxpartsize(): convert soil texture to Soil Taxonomy particle size classfragmentSieve(): classify coarse fragments by fragment diametertexmod_to_fragvoltot(): estimate ranges in coarse fragment volume based on a soil texture modifiertexture_to_texmod()fragvol_to_texmod()fragmentClasses(): coarse fragment diameter thresholds used by USDA-NRCSgetArgillicBounds(): estimate the upper and lower boundaries of an argillic horizongetCambicBounds(): estimate the upper and lower boundaries of a cambic horizongetSurfaceHorizonDepth()getMineralSoilSurfaceDepth()getPlowLayerDepth()hasDarkColors()estimatePSCS()generalize.hz(): apply REGEX rules to group horizon designations into a reduced set of "generalized horizon labels"evalGenHZ(): evaluate internal consistency of assigned GHLgenhzTableToAdjMat(): convert a cross-tabulation of GHL vs. original horizon designations to adjacency matrixget.ml.hz(): extract most likely horizon boundary depths from probability depth functions guessGenHzLevels(): estimate the correct ordering of GHL given horizon depthsGHL(): get/set GHL metadata for a SoilProfileCollectioninvertLabelColor(): automatic adjustment of label color for maximum contrast, based on specified background colorhzTransitionProbabilities(): derive transition probability matrix from horizon level datamostLikelyHzSequence(): use Markov Chains to predict the most likely sequence of horizonsshannonEntropy(): Shannon entropybrierScore(): Brier's scoretauW(): weighted tau statisticfindOverlap(): identify overlap within a vector of positions based on a given thresholdoverlapMetrics(): metrics of overlap within a vector or positions based on a given threshold fixOverlap(): attempt the minimum of adjustments to vector of positions such that a given distance threshold is enforced sp1sp2sp3sp4sp5sp6sierraTransectwilson2022rowley2019jacobs2000osdSPC.with.overlapus.state.soilssoil_mineralsmunsellequivalent_munsellmunsellHuePositionmunsell.spectraspectral.referenceROSETTA.centroidsreactionclasssoiltextureAny scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.