The compare() function reuses the variable wh for two unrelated purposes and doesn't seem to fit the use for contrasts construction variable cc at the end for some cases:
wh is first defined as:
wh <- is.na(pv$predicted.value)
And then, inside the PVAL branch it is redefined, and only when if length(nterm) > 1:
however the term is then used again outside if length(nterm) > 1:
cc <- list(coef = (1:lenf)[!wh], type = "con", comp = mat)
which would still point to the first definition is.na(pv$predicted.value) in some branch of the evaluation?
The
compare()function reuses the variablewhfor two unrelated purposes and doesn't seem to fit the use for contrasts construction variableccat the end for some cases:whis first defined as:And then, inside the PVAL branch it is redefined, and only when
if length(nterm) > 1:however the term is then used again outside
if length(nterm) > 1:which would still point to the first definition
is.na(pv$predicted.value)in some branch of the evaluation?