Algorithms for Quantitative Pedology: a toolkit for digital soil morphometrics

D.E. Beaudette, P. Roudier, J.M. Skovlin









This document is based on aqp version 1.8-8

Why do we need (yet) another framework?

alt text

  • soil data are complex, inherently visual
  • reproducibility is increasingly important
  • focus on the interesting questions, not boilerplate
  • a common vocabulary for soil data analysis would be nice

Soil data analysis in theory

alt text

In practice, it is a long road ...

alt text

Improving the workflow

alt text

Why R?

  • repeatable, self-documenting work:

    • 2800+ packages on CRAN: 100+ packages on GIS, ecology, and soils!
    • package system: algorithms + docs + sample data
  • advanced data visualisation capabilities

  • algorithm development by experts, application by trained users

    • testing by eye: simple graphical “grammar” used to plot data
    • formalized testing: correlation, regression, classification, ordination, …
    • I/O capabilities: file, URL, SOAP, SQL, ODBC, PDF, PNG, SHP, KML, …
    • optimizers, matrix operations, custom data structures, …

aqp package: Algorithms for Quantitative Pedology

alt text

  • special data structures: avoids annoying book-keeping code
  • visualization: soil profile sketches, transect diagrams, Munsell →  RGB
  • re-sampling: regular depth-slicing or EA spline (coming soon)
  • aggregation: summary by depth-slice or arbitrary “slabs”
  • classification: pair-wise dissimilarity of profiles
  • utility functions: soil depth, missing data eval., simulation, …

Details: papers, project homepage

alt text alt text

This talk: dog and pony show

SoilProfileCollection objects

Formal class 'SoilProfileCollection' [package "aqp"] with 7 slots
  ..@ idcol     : chr "peiid"
  ..@ depthcols : chr [1:2] "hzdept" "hzdepb"
  ..@ metadata  :'data.frame':  1 obs. of  1 variable:
  ..@ horizons  :'data.frame':  308 obs. of  34 variables:
  ..@ site      :'data.frame':  54 obs. of  59 variables:
  ..@ sp        :Formal class 'SpatialPoints' [package "sp"] with 3 slots
  ..@ diagnostic:'data.frame':  177 obs. of  4 variables:

plot of chunk SPC-2

SoilProfileCollection objects

  • object inspection
idname(sp4) # pedon ID name
horizonDepths(sp4) # colum names containing top and bottom depths
depth_units(sp4) # defaults to 'cm'
metadata(sp4) # data.frame with 1 row
profile_id(sp4) # vector of profile IDs
  • overloads to common functions
length(sp4) # number of profiles in the collection
nrow(sp4) # number of horizons in the collection
names(sp4) # column names from site and horizon data
min(sp4) # shallowest profile depth in collection
max(sp4) # deepest profile depth in collection
sp4[i, j] # get profile "i", horizon "j"
  • getting / setting of components
horizons(sp4) # get / set horizon data
site(sp4)  # get / set site data
diagnostic_hz(sp4) # get / set diagnostic horizons
proj4string(sp4) # get / set CRS
coordinates(sp4) # get / set coordinates
  • coercion to SpatialPointsDataFrame or data.frame
as(sp4, 'SpatialPointsDataFrame')
as(sp4, 'data.frame')

Munsell Color Conversion

alt text

Plotting SoilProfileCollection Objects

alt text

Plotting SoilProfileCollection Objects

alt text

Plotting SoilProfileCollection Objects

alt text

Plotting SoilProfileCollection Objects

alt text

Plotting SoilProfileCollection Objects

alt text

Slice-Wise Aggregation: RIC via quantiles

alt text

Slice-Wise Aggregation: RIC via quantiles

alt text

Slice-Wise Aggregation: RIC via quantiles

alt text

Slice-Wise Aggregation: probabilities

alt text

Slice-Wise Aggregation: probabilities

alt text

alt text

Pair-Wise Dissimilarity

alt text

Pair-Wise Dissimilarity

alt text

Recent (last hour) developments, inspired group discussion

  • inspired by Darrell et al. (thanks Pierre)
    • depiction of structure|fabric via unconditional sim. (variogram)
    • not perfect, but illustrates rapid protoyping framework

alt text

  • on deck for next week (thanks Pierre)
    • more efficient SoilProfileCollection implementation + images
    • EA spline methods for SoilProfileCollection
    • integration of hz boundary topography / distinctness into sketches

Concluding remarks

  • managing soils data can be difficult and time-consuming
  • DSM requires considerable data processing
  • DSM requires detailed analysis of soil profile collections or aggregate soils data

AQP can help:

  • simple conversion from common data sources to SoilProfileCollection
  • SoilProfileCollection objects are powerful
  • innovative constructs: slice(), slab(), SPC[i,j]
  • pair-wise dissimilarity: profile_compare()
  • visual comparisons and non-parametric summaries

AQP speaks digital soil morphometrics


Thank You!


http://aqp.r-forge.r-project.org