Learn R Programming

apsimx (version 2.8.271)

compare_apsim_soil_profile: Compare two or more soil profiles

Description

Helper function which allows for a simple comparison among soil_profile objects

print method for ‘soil_profile_mrg’

plotting function for compare_apsim_soil_profile, it requires ggplot2

Usage

compare_apsim_soil_profile(
  ...,
  soil.var = c("all", "Thickness", "BD", "AirDry", "LL15", "DUL", "SAT", "KS", "Carbon",
    "SoilCNRatio", "FOM", "FOM.CN", "FBiom", "FInert", "NO3N", "NH4N", "CACO3", "PH",
    "ParticleSizeClay", "ParticleSizeSilt", "ParticleSizeSand"),
  property,
  labels,
  merge.wide = TRUE,
  check = FALSE,
  verbose = FALSE
)

# S3 method for soil_profile_mrg print(x, ..., format = c("wide", "long"), digits = 2)

# S3 method for soil_profile_mrg plot( x, ..., plot.type = c("depth", "vs", "diff", "density"), pairs = NULL, soil.var = c("all", "Thickness", "BD", "AirDry", "LL15", "DUL", "SAT", "KS", "Carbon", "SoilCNRatio", "FOM", "FOM.CN", "FBiom", "FInert", "NO3N", "NH4N", "CACO3", "PH", "ParticleSizeClay", "ParticleSizeSilt", "ParticleSizeSand"), property, span = 0.75 )

Value

object of class ‘soil_profile_mrg’, which can be used for further plotting

a table with indexes for the soil profiles

it produces a plot

Arguments

...

‘soil_profile’ objects. Should be of class ‘soil_profile’

soil.var

soil variable to plot

property

same as soil.var

labels

labels for plotting and identification of ‘soil_profile’ objects.

merge.wide

whether to attempt to merge soils in ‘wide’ format.

check

whether to check ‘soil_profile’ objects using ‘check_apsimx_soil_profile’.

verbose

whether to print agreement values (default is FALSE).

x

object of class ‘soil_profile_mrg’

format

either ‘wide’ or ‘long’, which depends on the merging.

digits

number of digits to print (default is 2)

plot.type

either ‘depth’, ‘vs’, ‘diff’ or ‘density’

pairs

pair of objects to compare, defaults to 1 and 2 but others are possible

span

argument to be passed to ‘geom_smooth’

Examples

Run this code
if (FALSE) {
require(soilDB)
require(sp)
require(sf)
require(spData)
# Get two soil profiles
sp1 <- get_ssurgo_soil_profile(lonlat = c(-93, 42))
sp2 <- get_ssurgo_soil_profile(lonlat = c(-92, 41))
# Compare them
cmp <- compare_apsim_soil_profile(sp1[[1]], sp2[[1]], labels = c("sp1", "sp2"))
# Plot the variables
plot(cmp)
}

Run the code above in your browser using DataLab