You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stan_surv() exits with an error with R>=4.3 because of changes introduced to the default behavior of the || operator.
Description:
stan_surv() checks that the censoring indicator variable is not < 0 or > 3 using the || operator. The new behaviour of || makes stan_surv() exit with an error.
* Calling && or || with LHS or (if evaluated) RHS of length greater
than one is now always an error, with a report of the form
'length = 4' in coercion to 'logical(1)'
Reproducible Steps:
> library(survival)
> library(rstanarm)
> surv <- stan_surv(Surv(futime, death) ~ mspike,
+ data = mgus,
+ basehaz = "weibull",
+ chains = 1,
+ seed = 1234)
Error in status < 0 || status > 3 :
'length = 241' in coercion to 'logical(1)'
RStanARM Version:
2.21.3 from the survival devel branch
R Version:
4.3.1
Operating System:
macOS 13.4.1
The text was updated successfully, but these errors were encountered:
anddis
changed the title
stan_surv exits with an error because of new base::if()stan_surv exits with an error because of changes in || (R≥4.3)
Jun 27, 2023
Awesome, thanks @anddis for picking this up, and suggesting the fix! Yeah it looks like | should have probably been the appropriate choice in the first place, or perhaps ( any(status < 0) || any(status > 3) ).
I've merged your suggestion into the feature/survival branch: #594.
I believe we still don't any automated build / tests on that branch yet, which is horrendously discomforting 😅, but hopefully all is ok - so I'll close the issue, but we can reopen it if there are still problems! 🙂
Summary:
stan_surv()
exits with an error with R>=4.3 because of changes introduced to the default behavior of the||
operator.Description:
stan_surv()
checks that the censoring indicator variable is not< 0
or> 3
using the||
operator. The new behaviour of||
makesstan_surv()
exit with an error.See: https://stat.ethz.ch/pipermail/r-announce/2023/000691.html
Reproducible Steps:
RStanARM Version:
2.21.3 from the survival devel branch
R Version:
4.3.1
Operating System:
macOS 13.4.1
The text was updated successfully, but these errors were encountered: