Learn R Programming

mpspline2 (version 0.1.9)

mpspline_fit1: Fit spline parameters

Description

Fit spline parameters to data for a single site.

Usage

mpspline_fit1(
  s = NULL,
  p = NULL,
  var_name = NULL,
  d = NULL,
  vhigh = NULL,
  vlow = NULL
)

Value

list of two vectors: fitted values at 1cm intervals and the average of same over the requested depth ranges.

Arguments

s

data.frame; data for one site

p

list; estimated spline parameters for one site from mpspline_est1

var_name

character or integer vector denoting the column(s) in obj in which target data is stored. If not supplied, the fourth column of the input object is assumed to contain the target data.

d

sequential integer vector; denotes the output depth ranges in cm. Defaults to c(0, 5, 15, 30, 60, 100, 200) after the GlobalSoilMap specification, giving output predictions over intervals 0-5cm, 5-15cm, etc.

vhigh

numeric; constrains the maximum predicted value to a realistic number. Defaults to 1000.

vlow

numeric; constrains the minimum predicted value to a realistic number. Defaults to 0.