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
Follow-up to #958 with idea from @collinf1 about how warnings can be handled instead of muffled.
NEST/teal.modules.clinical/issues/674) .
For the record, note that the message is caught and nothing indicates a message was generated. Alternatively, an adapted construction from below could be used to capture the message and eventually attached as an attribute to the result.
try_car_anova<-function(mod,
test.statistic) { # nolinty<- tryCatch(
withCallingHandlers(
expr= {
warn_text<- c()
list(
aov=car::Anova(
mod,
test.statistic=test.statistic,
type="III"
),
warn_text=warn_text
)
},
warning=function(w) {
# If a warning is detected it is handled as "w".warn_text<<- trimws(paste0("Warning in `try_car_anova`: ", w))
# A warning is sometimes expected, then, we want to restart# the execution while ignoring the warning.
invokeRestart("muffleWarning")
}
),
finally= {
}
)
return(y)
}
Provenance:
Creator: anajens
The text was updated successfully, but these errors were encountered:
Follow-up to #958 with idea from @collinf1 about how warnings can be handled instead of muffled.
NEST/teal.modules.clinical/issues/674) .
Provenance:
The text was updated successfully, but these errors were encountered: