aqp 1.25
This release of aqp
marks a significant step towards major changes planed for version 2.0. Since 1.17, there have been major changes to the internals of the SoilProfileCollection
object (thanks to @brownag) and associated methods. We expect some evolution (but less drastic as compared to the previous release) before version 2.0.
See NEWS.md for a complete listing of changes.
Important Changes
estimateSoilDepth
losestop
andbottom
arguments, these are automatically extractedcombine
replaces/expandsaqp::union
due to conflicts withbase::union
split
receives some upgrades to the S4 definition to increase parity withsplit.default
filter
is now an alias for new methodsubset
, which mirrorsbase::subset
- default horizon ID (
hzID
) is now acharacter
data type
Enhancements
SoilProfileCollection
Internals
- new function
duplicate
will makes copies of profiles within aSoilProfileCollection
- two new SoilProfileCollection wrapper methods:
munsell2SPC
,spc2mpspline
- improvements to
glom(..., invert=TRUE)
,glomApply
, and better tests - new wrapper method around
glomApply
:trunc
for cases when top and bottom depth interval is the same for all profiles in a SoilProfileCollection - enhanced SoilProfileCollection object validity checks via S4; new method
spc_in_sync
(#152) - optimization of
[
subset method and optional use ofdata.table
(#155) depths<-
has been optimized and minimally validates input datacombine
usesdepths<-
internally; explicitly enforcing profile ID + top depth order in horizon data is safer but results in different ordering ifunion
-ing IDs that "intermingle" (need to be re-sorted).- new experimental method is
permute_profile
; similar tosim
but for boundaries. The interface to this function is likely to change/be expanded. - basic support for promotion of
tbl_df
anddata.table
to SoilProfileCollection - new method
aqp_df_class
to determine class name in use in a SoilProfileCollection object - optimization of
[i,]
[,j]
subset methods for data.frame-based slots (#135) - new verbs:
mutate
,mutate_profile
(#118) - define
[[
subsetting method; an "ambivalent" accessor for site- or horizon-level properties - new subset verbs
grepSPC
,filter
,subApply
for use in%>%
-lines
Color / Visualization
- simulate subtractive mixtures of Munsell colors with
mixMunsell
- see companion function
plotColorMixture
for visualization of spectra / mixture
- see companion function
- complete overhaul of
textureTriangleSummary
:- uses
soiltexture
package for visualization (plotrix
implementation dropped) - argument names changes (! may break old code, sorry)
- dropped simulation via
sim = TRUE
argument, seebootstrapSoilTexture
for a better approach
- uses
- new function
bootstrapSoilTexture
for simulating realistic sand/silt/clay compositions - add
returnData
argument tocontrastChart
plotSPC
upgrades (#146)
Everything Else
- new methods related to mollic epipedon:
mollic.thickness.requirement
,hasDarkColors
- new
estimateSoilDepth
-like methods for depth to multiple features via pattern matching:depthOf
,minDepthOf
,maxDepthOf
- soil texture helper functions:
ssc_to_texcl
,texcl_to_ssc
,texmod_to_fragvoltot
,texture_to_taxpartsize
c/o @smroecker - added
segment
c/o @smroecker
Additions
- new lookup table
pms.munsell.lut
for converting Pantone spot color codes to (closest) Munsell chip - new example data
us.state.soils
: 50 state soils + PR and VI soils - ROSETTA centroids and water retention by texture class (#131)
Bug Fixes
- fix for routing of
NULL
through$<-
andhorizons<-
orsite<-
(#163) - fix handling of missing metadata in (old) serialized SoilProfileCollection objects
- fix for promotion of
data.table
with character vector (not formula) interface - fix for unit-length and zero-length legends in
plotSPC
- fix for
plot
generic to showaqp::plot
in?plot
- fix for
getSurfaceHorizonDepth
with buried horizons / non-contiguous instances of matching horizons (#132) - fix for default
plotSPC
with small number of profiles (#128) - remove implicit conversion to SpatialPointsDataFrame with unit-length
[
j-index subset ((#125) - fix in slab when
slab.structure[2] > max(x)
New Compatibility with Pipe-based Workflows!
The SoilProfileCollection
object is now compatible with {magrittr} pipe %>%
based workflows. Here is an example using select soil morphologic data from Jacobs (2002) "Redoximorphic Features as Indicators of Seasonal Saturation, Lowndes County, Georgia", a sample dataset available in {aqp} (jacobs2000
)
# {aqp} + {magrittr} pipes
library(aqp)
library(magrittr)
# see ?jacobs2000 for details
data("jacobs2000", package = "aqp")
# create a base plot to inspect full dataset
par(mar=c(0,0,0,2))
plot(jacobs2000, color = "matrix_color",
plot.order = order(jacobs2000$time_saturated))
# select 3 profiles along gradient, and truncate 50-150cm interval
jacobs.sub <- jacobs2000 %>%
subset(profile_id(.) %in% c("92-2","92-4",'92-7')) %>%
trunc(50, 150)
# create a base plot
plot(jacobs.sub, color = "matrix_color")
# add redox concentrations
jacobs.sub %>% addVolumeFraction('concentration_pct',
col = .$concentration_color,
pch = 16, cex.max = 1)
# add redox depletions
jacobs.sub %>% addVolumeFraction('depletion_pct',
col = .$depletion_color,
pch = 16, cex.max = 1)