plot_ea_spline: plot soil profile outputs from 'ea_spline'

Description Usage Arguments Value Note Author(s) Examples

View source: R/plot_ea_spline.R

Description

This is a simple function for plotting outputs and soil profile data from the ea_spline function.

Usage

1
plot_ea_spline(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

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

Note

This is a companion function for ea_spline. This function is really designed to plot one soil profile at a time. Would need to be inserted into another function if plotting of a collection of soil profiles is required.

Author(s)

Brendan Malone

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
library(ithir)
library(aqp)

data(oneProfile)
str(oneProfile)

#convert to SoilProfileCollection object
depths(oneProfile)<- Soil.ID ~ Upper.Boundary + Lower.Boundary


#fit spline
eaFit <- ea_spline(oneProfile, var.name="C.kg.m3.",d= t(c(0,5,15,30,60,100,200)),lam = 0.1, vlow=0, show.progress=FALSE )

#do plot
plot_ea_spline(splineOuts=eaFit, d= t(c(0,5,15,30,60,100,200)), maxd=200, type=1, label="carbon density") 

ithir documentation built on May 2, 2019, 4:49 p.m.

Related to plot_ea_spline in ithir...