Causes a failure with R 4.2 for custom anonymous fitter functions
Error in if (deparse(substitute(fitter)) == "lm") warning("If you use print, summary, or anova on the result, lm methods use the\nsum of squared residuals rather than the Rubin formula for computing\nresidual variance and standard errors. It is suggested to use ols\ninstead of lm.") :
the condition has length > 1
This is due to a significant change in R 4.2:
Calling if() or while() with a condition of length greater than
one gives an error rather than a warning. Consequently,
environment variable _R_CHECK_LENGTH_1CONDITION no longer has
any effect.
An happens because anonymous functions get deparsed as demonstrated below
test = function(fitter) {
print(deparse(substitute(fitter)))
}
# pass anonymous function
test(function(){NULL})
This line:
https://github.com/harrelfe/Hmisc/blob/1b9c83e116dde149c72e443ad6065aa946547e14/R/fit.mult.impute.s#L9
Causes a failure with R 4.2 for custom anonymous fitter functions
This is due to a significant change in R 4.2:
An happens because anonymous functions get deparsed as demonstrated below
Prints three elements: