knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

R-CMD-check Coverage status CRAN Downloads

mpspline2

This package is a standalone re-implementation of GSIF::mpspline(), which applies a mass-preserving spline to soil attributes. Splining soil data is a safe way to make continuous down-profile estimates of attributes measured over discrete, often discontinuous depth intervals.

Installation

Install from CRAN with

install.packages('mpspline2')

Install from github with

devtools::install_github("obrl-soil/mpspline2")

Example

library(mpspline2)
dat <- data.frame("SID" = c( 1,  1,  1,  1),
                   "UD" = c( 0, 20, 40, 60),
                   "LD" = c(10, 30, 50, 70),
                  "VAL" = c( 6,  4,  3, 10),
                   stringsAsFactors = FALSE)
dat
spl_dat <- mpspline_tidy(obj = dat, var_name = 'VAL')
spl_dat$est_dcm

Asking for help

If you get stuck using this package, please post a question on Stack Overflow. This means that others can benefit from the discussion, and more people are available to help you. You're welcome to ping me in a comment or on twitter (@obrl_soil) to get my attention.




obrl-soil/mpspline2 documentation built on Feb. 1, 2024, 7:55 p.m.