I have three tables:
Upper Bound
Q C
1 30
2 50
3 40
Lower Bound
Q C
1 10
2 15
3 20
Bad Data:
Q C Name
1 50 Sample 1
2 40 Sample 1
3 30 Sample 1
1 0 Sample 2
2 60 Sample 2
3 5 Sample 2
I want a graph that graphs the lower and upper bounds in gray and fills everything in between and graph the bad samples on top with different colors and a legend:
plot <- ggplot(Bad_Data, aes(x = Bad_Data$Q, y = Bad_Data$C, group = 1))
plot + geom_line(aes(color = N)) + geom_ribbon(aes(ymin = Lower_Bound$C, ymax = Upper_Bound$C))
I tried that but it gave me this error:
Error: Aesthetics must be either length 1 or the same as the data (624): ymin, ymax, x, y, group
Anyone who can help me?