I have enjoyed the runjags package and use it heavily in my "blavaan" package. I recently came across a small error in runjags 2.0.3-2 that seems to have arisen upon upgrade to R 3.3.0.
The error occurs in the timestring() function when time2 is NA. I believe this can cause some model estimation to fail when the gelman.diag is large. (For example, if line 415 or 501 of autoextend.jags.R is triggered, we get the error "'tim' is not character or numeric".)
Many thanks for the bug report - I have been slow to upgrade to R 3.3.0 so had not noticed this yet myself. I have updated the timestring function to handle this scenario in a better fashion, and this update will be included in the next version of runjags.
Thanks again,
Matt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Alexey - this was fixed a month or so ago, but I haven't got around to submitting a new version to CRAN yet. It will be in the next update though!
Thanks again to both of you for taking the time to report these issues!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Matt,
I have enjoyed the runjags package and use it heavily in my "blavaan" package. I recently came across a small error in runjags 2.0.3-2 that seems to have arisen upon upgrade to R 3.3.0.
The error occurs in the timestring() function when time2 is NA. I believe this can cause some model estimation to fail when the gelman.diag is large. (For example, if line 415 or 501 of autoextend.jags.R is triggered, we get the error "'tim' is not character or numeric".)
Example of the error:
time1 <- as.difftime(5, units="secs")
runjags:::timestring(time1)
It seems that the na.omit() line in timestring() is failing because it does not like a time object being combined with NA.
Best,
Ed
Hi Ed
Many thanks for the bug report - I have been slow to upgrade to R 3.3.0 so had not noticed this yet myself. I have updated the timestring function to handle this scenario in a better fashion, and this update will be included in the next version of runjags.
Thanks again,
Matt
Loosely related, but there's another bug in
autoextend.jags.R
.Around line 495, you currently have:
...when in fact, it should be
if(!is.numeric(...))
. This causes the function to break on theround()
call.Thanks Alexey - this was fixed a month or so ago, but I haven't got around to submitting a new version to CRAN yet. It will be in the next update though!
Thanks again to both of you for taking the time to report these issues!