I have a data frame structured like this:
set.seed(123)
data<- data.frame(
ID=factor(letters[seq(20)]),
Location = rep(c("alph","brav", "char","delt"), each = 5),
Var1 = rnorm(20),
Var2 = rnorm(20),
Var3 = rnorm(20)
)
I have built a linear model: mod1 <- lm(Var1~Location,mydata)
. When I use: plot(mod1)
on the linear model object, outliers are labeled with the index of the value. Is there a way to label those points with the value in ID
? In other words, in this example values 6, 16, and 18 are labeled in the plots, and I want to them to be labeled with f, p, and r, respectively, because those are their corresponding values in ID