oss.plot_spl: Plot the output of optsline function

View source: R/oss.plot_spl.R

oss.plot_splR Documentation

Plot the output of optsline function

Description

This function is identical to plot_ea_spline function from the ithir package maintained by Brendan Malone and available on bitbucket. The diffrence is in how the xlim argument is set for plotting and provides wider x axis.

Usage

oss.plot_spl(
  splineOuts,
  d = t(c(0, 5, 15, 30, 60, 100, 200)),
  maxd,
  type = 1,
  label = "",
  plot.which = 1
)

Arguments

splineOuts

list; This is a returned object from the ea_spline function

d

numeric; standard depths that were used during the fitting from ea_spline.

maxd

numeric; Maximum soil depth for generating the outputs plots/s

type

numeric; Different themes of plot may be exported. Type 1 is to return the observed soil data plus the continuous spline (default). Type 2 is to return the observed data plus the averages of the spline at the specified depth intervals. Type 3 is to return the observed data, spline averages and continuous spline.

label

Character; Optional label to put on x-axis of plot.

plot.which

numeric; Integer selction of which plot to produce if multiple soil profiles have been fitted using the ea_spline function.

Value

Returns a labeled plot of the soil profile information and user selected ea_spline outputs.

Examples

data(profiles)
fit<- oss.optSpline(obj=profiles, var.name="pH_CaCl2",
lam= c(10, 1, 0.1, 0.01, 0.001), d=t(c(0,5,15,30,60,100)),
vlow= 0, vhigh= 9, save.plots=FALSE)
oss.plot_spl(splineOuts= fit, d= t(c(0,5,15,30,60,100)), maxd= 100, type=3, label= "Soil pH")


newdale/onsoilsurvey documentation built on Jan. 5, 2024, 1:35 a.m.