I would like to automatically draw a vertical line at the intersect of two
geom_density() plots in
data %>% ggplot(aes(score, fill = actual_given_therapy)) + geom_density(alpha = 0.5) + geom_vline(xintercept = 3, color = "black")
If I would know the two functions created by
geom_density(), I guess it is possible to find the intersection with
uniroot(), but is it even possible to extract them?
I want to show the theoretical threshold of a test visually.
Thank you for your help guys!