-
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
Make aqp::union() robust to profile ID / site attr collisions. #161
Comments
Relevant
|
Yep, this arises from unanticipated and rare? differences in |
Take a look at |
Another test case to consider. library(aqp)
library(soilDB)
x <- fetchOSD('musick')
# replication of original data... maybe we need a new function for this
horizons(x)$bdy <- 0
s <- permute_profile(x, n=6, boundary.attr = 'bdy')
# Error in aqp::union(list(x, s)) : non-unique profile IDs detected
z <- aqp::union(list(x, s))
# Error: duplicate names in new site / existing horizon data not allowed
z <- aqp::union(list(s, x)) |
From debug inside of
This is a special case of how non-conformal IDs are handled by union. It runs afoul of the SPC rebuilding: The retaining of original So there needs to be a message, or something, for the nonconformal ID selection, possibly recalculation of a brand new Temporary fix is to calculate a new profile ID column for the two SPCs that is unique in both name and value prior to unioning. |
Nice, this is what I needed to see. I think that the current implementation took a shortcut by re-naming the ID column vs. making a new one (I recall debating this in my head). |
I think this has been fixed in this draft PR. #168 Here is a quick demo of the functionality. Still probably need to further try to break it.
|
The text was updated successfully, but these errors were encountered: