Bugzilla – Bug 15458
Incorrect labelling factor levels in plot.lm
Last modified: 2013-09-26 16:07:28 UTC
The function plot.lm appears to incorrectly label factor levels in the "Constant Leverage: Residuals vs Factor Levels" plot.
Example (using attached data)
river <- read.table(file="river.txt",header=T)
river.lm <- lm(Aldrin ~ Depth, data=river)
The labels for "Surface" and "Bottom" are reversed.
Created attachment 1485 [details]
Example test dataset
This is another manifestation of bug 14837. In that case, I thought that the solution was to undo the sorting, but was convinced not to do that. That solution also works here...
Fixed in R-devel and R-patched as of r63999.