plot(income ~ education, Prestige)
with(Prestige, showLabels(education, income,
labels = rownames(Prestige), id.method=list("x", "y"), id.n=3))
m <- lm(income ~ education, Prestige)
plot(income ~ education, Prestige)
abline(m)
with(Prestige, showLabels(education, income,
labels=rownames(Prestige), id.method=abs(residuals(m)), id.n=4))
Run the code above in your browser using DataCamp Workspace