-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Soil depth and the behaviour of min
and max
#175
Comments
Thanks for the detailed explanation Pierre. I see where you are coming from, a direction that hadn't occurred to me when first overloading these base functions. Outside of those cases where you have soil samples which do not truly represent soil profiles (truncated to depth slices or slabs, grab samples, or ???), do you expect Long-term it makes a lot of sense: the original idea behind For aqp 2.0, where we can break things, this seems possible and I support the extensive changes required. I expect that there will be a lot of tedious work in {aqp}, some in {soilDB}, and perhaps some as well in {sharpshootR}. I do not know how many other things will be affected but I do know that this could be a breaking change without much of a safety net. Here is a rough plan:
|
I also stumbled over the whole "min is the min of the max" thing when I (attempted) to make the You can see the comments and benchmarks I put there in line. At the time I was thinking that I would be able to beat
I support this. Here is an example with a function that I use a lot where the proposed changes to
I agree that "soil depth" is a more nuanced definition. The values we report in the I do look at it when I have I wrote a blog about the complex issues around soil depth estimation in aqp. That is not saying anyone has to read said blog, but just pointing out that there are a lot of things to be said, and to consider, when talking about "pedologic" depth. |
Most such cases would be profiles that have recorded the organic/humic horizon above the mineral fraction, and that are using negative depth values to indicate that. Otherwise we have some marginal cases where people focused on subsoil etc: in terms of soil information system, we moved from something very profile-centric, to something a lot more holistic, where if anyone measures anything about soil (even if it's not a full profile description), we will capture and record it. |
Have you considered using the
|
I have seen that package and thought it may be useful.
We run into a variety of things in US taxonomy/soil survey that affect the window of interest and making the profile specific adjustments is pretty important for some of our analyses and criteria. You raise the point of organic materials, negative depths and the like. Conventionally, our soil surface is at zero, but for instance a lot of our old lab data starts at some value greater than zero because OSM was not sampled for analysis. Historically values may have used negative depths, and we do see it turn up in old descriptions and rarely in the database. There are many other cases where a workflow like yours above would be handy when aggregation is occurring over known constant intervals. I'll surely consider it, but I doubt I would bring in a whole 'nother package for relatively simple vector operations. |
It might be more handy to have raw row indices of the horizon data.frame rather than |
Lets pursue this idea, given all of the new findings in #199. We have to be careful though: changing the current |
Following up on a chat between @dylanbeaudette and myself.
I've reversed a commit I've just pushed, as this is a drastic change that requires discussion.
At the moment,
min
andmax
are overloading thebase
functions. For horizons that are bounded in depth by "top" and "bottom":max
gives the absolute maximum "bottom" depth in the collection, iemax(spc$bottom)
min
gives the minimum of the profile-specific max(bottom).I understand this makes sense from a pedological perspective, where "soil depth" is the maximum depth of a profile. However, I don;t think the behaviour is appropriate for
min
.Consider
sp4
:In this case:
I think the problem arises in particular when looking over a collection of soil profiles:
In particular this bit:
gives the impression that the collection only spans the 16--49 cm depth.
It's very much a wording issue:
I would argue for
min
andmax
to refer to horizon depths, which are very simple, basic data concepts, and correspond tomin(top)
andmax(bottom)
respectively. This would be some low-level, data wrangling function.On the other hand, I would propose that the more complex concept of soil profile depth being given its own, specific function (
soil_depth(x)
?). Arguably this effective soil depth can be calculated using different approaches, which this more advanced function could accommodate.Separating convenience functions that purely report the data, from functions that report a science concept.
The revised
min
for reference:The text was updated successfully, but these errors were encountered: