View source: R/apsimx_soil_profile.R
compare_apsim_soil_profile | R Documentation |
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
compare_apsim_soil_profile( ..., soil.var = c("all", "Thickness", "BD", "AirDry", "LL15", "DUL", "SAT", "KS", "Carbon", "SoilCNRatio", "FOM", "FOM.CN", "FBiom", "FInert", "NO3N", "NH4N", "PH"), labels, check = FALSE, verbose = FALSE ) ## S3 method for class 'soil_profile_mrg' print(x, ..., digits = 2) ## S3 method for class 'soil_profile_mrg' plot( x, ..., plot.type = c("depth", "vs", "diff", "density"), pairs = c(1, 2), soil.var = c("all", "Thickness", "BD", "AirDry", "LL15", "DUL", "SAT", "KS", "Carbon", "SoilCNRatio", "FOM", "FOM.CN", "FBiom", "FInert", "NO3N", "NH4N", "PH"), span = 0.75 )
... |
‘soil_profile’ objects. Should be of class ‘soil_profile’ |
soil.var |
soil variable to plot |
labels |
labels for plotting and identification of ‘soil_profile’ objects. |
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’ |
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’ |
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
I have only tested this for 2 or 3 objects. The code is set up to be able to compare more, but I'm not sure that would be all that useful.
## Not run: 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) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.