I have a simple geom_bar and geom_point and would like to colour bars and points based on values in data. My code is currently as follows:
```df <- (Test3)
ggplot(Test3,aes(ques,diff1,subj))+
geom_bar(stat = "identity")+
geom_point(aes(x=ques, y= diff2))+
facet_grid(~subj)
My chart currently looks like this: chart
My data looks likes this:
```# A tibble: 8 x 9
subj ques `%` `sect%` diff1 ci last_y diff2 tt
<chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 geog q1 82.1 83.6 -1.49 10.1 78 4.14 2.1
2 geog q2 80 50 30 10.1 54 26 -1.28
3 hist q1 92.9 83.6 9.21 10.1 NA NA NA
4 hist q2 85.7 82.8 2.94 10.1 NA NA NA
5 Sports q1 73.8 82.4 -8.61 10.1 95 -21.2 2.97
6 Sports q2 69.2 81.8 -12.6 10.1 12 57.2 -2.59
7 sci q1 78.6 85.2 -6.66 10.1 87 -8.43 -3
8 sci q2 78 50 28 10.1 55 23 2
What I would like is for bars to be green if diff1 >= ci, red if diff1 <= ci, and grey if neither. And for the points to be green if tt >= 1.96 or red if tt <= 1.96, and grey if neither. Would be grateful for assistance.