I want to add a vertical abline to the Pareto chart at the points where y is a quantile (see image below). The function I am using for Pareto chart is pareto.chart() in the "qcc" package and ggplot2 package. I am only using pareto.chart to get the cumulative y. I also previously, made the Pareto chart using pareto.chart(). It would be okay if you can create the Pareto with either of those.
My major concern is how to draw vertical lines at quartile. I was able to draw vertical lines at the deciles of the x-axis but not at the quartiles of the y-axis.
Here is the function:
xyz<-pareto.chart(Product, ylab = "Number of Products", xlab="Customer", xaxt="n")
xyz<-data.frame(xyz)
i2<-ggplot(data=xyz,
aes(x=seq(1,length(xyz$Frequency)),y=Cum.Percent.,group=1)) +
geom_line(colour="red", size=1) +
theme_classic() +
theme(axis.text.x = element_text(angle = 75, hjust = 1, size=8)) +
labs(x="Customer",y="Product Share (%)") +
ggtitle("Pareto Chart") +
ylim(0,100.1)
print(i2)
Image shows how it is and how I want. Basically, I want red lines at say 50% and 90% or at some decile or quartile of Y