Skip to content
Prev 60862 / 63424 Next

Problem with contrasts bug fix?

This worked previously but gives an error in R-devel (Windows today), triggering a warning to a package maintainer:

contr.none <- function(n) contrasts(factor(1:n), contrasts = FALSE)
lm(uptake~Treatment, CO2, contrasts=list(Treatment=contr.none))

Error in 1:n : NA/NaN argument
In addition: Warning messages:
1: In 1:n : numerical expression has 2 elements: only the first used
2: In factor(1:n) : NAs introduced by coercion