Open dylanbeaudette opened 4 years ago
Yup, that was the original "fix" for Pierre a while back: convert depths from m -> cm and round accordingly.
This won't happen until slice()
and many related functions have been re-written.
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))
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