I am trying to plot a total delay (in mins) vs aircraft name graph faceted by 12 months. The data set (p) that I am using has some variables like total delay, weather delay (in mins),carrier delay (in mins), aircraft name. (total delay = sum of 2 variables weather delay+carrier delay) I want fill as 2 variables (weather delay, carrier delay etc) I am able to plot a total delay vs aircraft but do not know how to fill in each bar with values of the 2 variables weather_delay and carrier delay.
ggplot(subset(p, airport %in% c( "IAD")) +
aes(x= aircraft_name, y = total_delay, color = airport) +
geom_histogram(stat ="identity",binwidth=1) +
facet_grid(~month,scales='free')
The problem I am facing is the dataset contains variables like weather delay, carrier delay, security delay which sum up to the total delay. I want to show every bar of total delay as a component of the 3 delays. The fill part should consist of the 3 variables delays.