# Superimpose the decision boundary on the scatterplot of GPA vs. GMAT
ggplot(train, aes(x = GPA, y = GMAT, color = Group)) +
geom_point() +
ggtitle("Scatterplot of GPA vs. GMAT by Group with LDA Decision Boundary") +
geom_contour(aes(z = predict(lda.fit, data.frame(GPA, GMAT))$class),
bins = 2, alpha = 0.5)
Error in Summary.factor(c(1L, 3L, 3L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, :
‘range’ not meaningful for factors