Skip to content
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

slice and slab ignore overlapping horizons #88

Closed
dylanbeaudette opened this issue Mar 15, 2019 · 1 comment
Closed

slice and slab ignore overlapping horizons #88

dylanbeaudette opened this issue Mar 15, 2019 · 1 comment

Comments

@dylanbeaudette
Copy link
Member

What is the correct output from slice and slab in the presence of overlapping horizons?

Overlapping horizons:

  • data-entry error, current strict behavior is ideal
  • "A/E" type horizon or multiple lab samples per genetic horizon: possibly wrong output
1: In get.slice(h, id = id, top = top, bottom = bottom, vars = vars,  :
  Bad horizonation detected, first matching horizon selected. Use strict=TRUE to enforce QA/QC.

Relevant notes from get.slice().

  • this function cannot deal with overlapping horizons (usually an error): > 1 row / slice
  • it would be useful to support these kind of data, as many lab-sampled sites have sub-samples

Example.

library(aqp)

# overlapping horizons by design
d <- data.frame(
  id='001',
  name=c('A', 'A/E', 'A/E', 'Bhs1', 'Bhs2', 'C1', 'C2'),
  top=c(0,5,5,10,20,50,80),
  bottom=c(5,10,10,20,50,80,100),
  var=c(15, 4, 8, 15, 18, 2, 3),
  v2=1,
  stringsAsFactors=FALSE
  )

# init SPC
depths(d) <- id ~ top + bottom

# error due to overlapping horizons
slice(d, 0:50 ~ ., strict=TRUE)

# warnings
s <- slice(d, 0:50 ~ ., strict=FALSE)

# should there be 2 rows of data here ?
# only the first is returned
s[1, 8]
@dylanbeaudette
Copy link
Member Author

Closing this, can re-open as needed for re-written slab and dice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant