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

support for non-integer depths #106

Open
dylanbeaudette opened this issue Jan 7, 2020 · 4 comments
Open

support for non-integer depths #106

dylanbeaudette opened this issue Jan 7, 2020 · 4 comments
Assignees
Milestone

Comments

@dylanbeaudette
Copy link
Member

No description provided.

@brownag
Copy link
Member

brownag commented Feb 10, 2020

If we had fractional centimeter data wouldn't it be possible to just multiply by 10, round, and switch depth units to "mm"? I'd be interested to see what functions break if one were to attempt something like that

@dylanbeaudette
Copy link
Member Author

Yup, that was the original "fix" for Pierre a while back: convert depths from m -> cm and round accordingly.

@dylanbeaudette
Copy link
Member Author

This won't happen until slice() and many related functions have been re-written.

@dylanbeaudette
Copy link
Member Author

Better than it used to be, but dice and slab aren't fully robust to non-integer depths. plotSPC works as expected.

library(aqp)

# testing non-integer depths

x <- list(
  id = 'P1',
  depths = c(6.5, 25.25, 33.3, 100.1, 150),
  name = c('A', 'AB', 'Bw', 'Bt', 'Cr'),
  clay = c(8, 12, 15, 22, 25)
)

s <- quickSPC(x)
plotSPC(s, name.style = 'center-center', cex.names = 1, plot.depth.axis = FALSE, hz.depths = TRUE)

checkHzDepthLogic(s)

## dice()

# almost
head(dice(s, SPC = FALSE), 10)

# nope
head(dice(s, fm = 0:10 ~ ., SPC = FALSE), 10)


## slab

# nope
slab(s, fm = ~ clay, slab.fun = mean)

# nope
slab(s, fm = ~ clay, slab.fun = mean, slab.structure = c(0, 100))

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

No branches or pull requests

2 participants