I have a density plot that look like this:
I want to add vertical lines that correspond to 25%, 50%, and 75% of the distribution for each facet.
I guess that I could do it "manually" by using the summary statistic of each years, but I'm supposing that there is a more efficient way?
Here is my code:
merge(usa_census_sub, CPI, by.x = "YEAR", by.y = "year")%>%
select(YEAR, INCWAGE, rate)%>%
filter(YEAR >= 1960 & INCWAGE !=999999 & INCWAGE !=0)%>%
mutate(log_INCWAGE <- (log10(INCWAGE)),
RWAGE = (log_INCWAGE/rate)*158)%>%
ggplot(usa_census_sub, mapping = aes(x= RWAGE))+
geom_density()+
facet_wrap(~YEAR)