| Title: | Stratigraphic Plug Alignment for Integrating Plug-Based and XRF Data |
|---|---|
| Description: | Implements the Stratigraphic Plug Alignment (SPA) procedure for integrating sparsely sampled plug-based measurements (e.g., total organic carbon, porosity, mineralogy) with high-resolution X-ray fluorescence (XRF) geochemical data. SPA uses linear interpolation via the base approx() function with constrained extrapolation (rule = 1) to preserve stratigraphic order and avoid estimation beyond observed depths. The method aligns all datasets to a common depth grid, enabling high-resolution multivariate analysis and stratigraphic interpretation of core-based datasets such as those from the Utica and Point Pleasant formations. See R Core Team (2025) <https://stat.ethz.ch/R-manual/R-devel/library/stats/html/stats-package.html> and Omodolor (2025) <http://rave.ohiolink.edu/etdc/view?acc_num=case175262671767524> for methodological background and geological context. |
| Authors: | Hope E. Omodolor [aut, cre] (ORCID: <https://orcid.org/0009-0005-7842-406X>), Jeffrey M. Yarus [aut] |
| Maintainer: | Hope E. Omodolor <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.6 |
| Built: | 2026-05-29 11:31:59 UTC |
| Source: | https://github.com/omodolor/spaalign |
Linearly interpolates plug-based measurements (e.g., TOC, porosity, XRD)
onto a high-resolution reference depth grid (e.g., XRF).
The procedure uses base R's approx() with rule = 1 (default)
to prevent extrapolation beyond the observed depth range, ensuring
stratigraphically consistent alignment of all datasets.
spa_align( ref, ..., depth_col = "Depth_m", rule = 1, add_suffix = TRUE, trim = FALSE )spa_align( ref, ..., depth_col = "Depth_m", rule = 1, add_suffix = TRUE, trim = FALSE )
ref |
A data.frame containing the reference depth grid and (optionally)
high-resolution variables (e.g., XRF). Must contain the depth column
specified in |
... |
One or more named data.frames containing plug-based measurements
to be interpolated (e.g., |
depth_col |
A character string giving the name of the depth column
shared by all input datasets. Defaults to |
rule |
Integer passed to |
add_suffix |
Logical; if |
trim |
Logical; if |
SPA is intended for vertically ordered core or log data, where measurements are indexed by depth along a stratigraphic profile.
A data.frame containing the reference depth grid and interpolated variables aligned to the same resolution.
ref <- data.frame(Depth_m = 0:10, Ca = runif(11, 100, 200)) xrd <- data.frame(Depth_m = c(2, 5, 7), Quartz = c(54, 60, 58)) plugs <- data.frame(Depth_m = c(3, 7, 9), TOC = c(3.0, 3.3, 3.5)) # Default: preserves reference depth grid aligned <- spa_align(ref, xrd = xrd, plugs = plugs) head(aligned) # Overlap-only alignment aligned_overlap <- spa_align(ref, xrd = xrd, plugs = plugs, trim = TRUE)ref <- data.frame(Depth_m = 0:10, Ca = runif(11, 100, 200)) xrd <- data.frame(Depth_m = c(2, 5, 7), Quartz = c(54, 60, 58)) plugs <- data.frame(Depth_m = c(3, 7, 9), TOC = c(3.0, 3.3, 3.5)) # Default: preserves reference depth grid aligned <- spa_align(ref, xrd = xrd, plugs = plugs) head(aligned) # Overlap-only alignment aligned_overlap <- spa_align(ref, xrd = xrd, plugs = plugs, trim = TRUE)