Closed baderstine closed 6 years ago
I think this is fixed in "develop" commit 79ca4e93ddb7a9ec6e41134d2d3ae3f243684848. A simplified test code is below, in which I check for value 1/2. This passes now, in the "develop" branch.
library(oce)
x <- c(0, 1)
y <- c(0, 1)
z <- c(0, 1)
f <- array(c(0, 1), dim=c(2,2,2))
i <- approx3d(x, y, z, f, xout=.5, yout=0.5, zout=0.5)
expect_equal(i, 0.5)
@baderstine -- if you are able to build oce from github, please have a look, and either close this issue or suggest further problems that ought to be addressed. If you cannot easily build from source, please just write a comment to that effect, and I'll wait a few days, in case other developers want to check, and then I'll close it next week, sometime.
Again, thanks for the issue report. We now have a lot more checks in approx3d
, and that's a good thing.
Hey! Sorry I am unable to build at this time. Thanks for the fix!
In case it helps, if you visit https://www.dropbox.com/sh/awlz31v1jj7w0ct/AACglLhtWga_xG30ThlX6wJHa?dl=0 you'll find built-up versions for macos (or osx) and for microsoft-windows. These are up to date as of today.
This issue has been closed, since it seems to have been addressed, and since discussion has stalled. The original reporter should feel free to reopen it, though, or to open new issues that might be related. Thanks.
PS. This is a standardized reply.
Short summary of problem
When attempting to interpolate one point in a very small 2x2x2 grid (e.g., test data), function
approx3d
throws an error rather than interpolating the value.What you did
What you expected to happen
function should return value = 0.5
Output from sessionInfo()
Matrix products: default BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib
locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] oce_0.9-23 gsw_1.0-5 testthat_2.0.0 rgl_0.99.16
loaded via a namespace (and not attached): [1] Rcpp_0.12.17 digest_0.6.15 mime_0.5
[4] R6_2.2.2 xtable_1.8-2 jsonlite_1.5
[7] magrittr_1.5 rlang_0.2.0.9000 miniUI_0.1.1.1
[10] webshot_0.5.0 tools_3.4.4 manipulateWidget_0.10.0 [13] htmlwidgets_0.9 crosstalk_1.0.0 shiny_1.0.5
[16] httpuv_1.3.5 yaml_2.1.16 compiler_3.4.4
[19] htmltools_0.3.6 knitr_1.17