require("ggplot2") ggplot(DATASET, aes(x=discount, y=hit, color=application, group=application)) + geom_points() + geom_smooth(method="lm")
Just change DATASET for the name of your dataframe.