Closed dpc10ster closed 2 years ago
Interesting. We have been in this bit of code before with issue #70.
yes; but this error is occurring in standard R code, not in testthat
function: sum(lesDistr) != 1.0
; I also tried sum(lesDistr) != 1
with same error; the only way to get past this "error" is to test the absolute value of the difference; makes no sense to me;
Just checking in. Still working on trying to solve this one. A tricky issue.
Thanks. Take your time;
On Sun, Jul 17, 2022 at 8:06 AM Peter Phillips @.***> wrote:
Just checking in. Still working on trying to solve this one. A tricky issue.
— Reply to this email directly, view it on GitHub https://github.com/dpc10ster/RJafroc/issues/76#issuecomment-1186498358, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH4NJRBQBX7SWCE2T52EB3LVUPZMJANCNFSM53MHIFJA . You are receiving this because you authored the thread.Message ID: @.***>
OK - try this:
The line if (sum(lesDistr) != 1.0)
looks like a valid comparison, but a more robust alternative is:
if ( !isTRUE( all.equal( sum(lesDistr), 1.0 ) ) )
...as mentioned in https://search.r-project.org/R/refmans/base/html/all.equal.html. The isTrue()
wrapping function is important.
I'm hopeful that this will fix the sum-to-unity check.
I have tested on "macos-m1-bigsur-release" and the sum error has gone away with your fix. I am surprised that we have to go through such contortions to test the equality of two numeric values.
The other error, i.e., the ggplot2 error in building vignette 1, will go away when we delete the 2 vignettes. I need to put a link in the R file on where to find these in the bookdown version.
This issue reared its ugly head in one more place; see 9c686aba7f2697493c959464ea007162dbc07bc7 With this fix this branch builds OK on Apple Silicon (M1), macOS 11.6 Big Sur, R-release:
File
inst\cranSubmission\cranSubmission.R
is same as in previous issue (rhub check failures 2 of xx oncran4a
branch).Code for this issue is on branch cran4b.
The difference is in file
SsFrocNhRsmModel.R
: currently the relevant lines are:vs. previous code
And here is the relevant output:
Cannot figure out why sum of 0.70000 0.20000 0.10000 is not unity.