I am using a dataset wherein the values are as follows :
ad fl
300 1
400 1
450 2
600 4
700 2
350 1
700 3
900 5
1100 5
700 6
430 3
640 4
I want to plot a bar chart based on the median values of ad against the fl. Note that I need the median values of ad based on fl. I am using this command
ggplot(data=dataForGraph, aes(x=fl, y= median(ad))) +
geom_bar(stat="identity", fill="steelblue")
But it doesn't give a correct graph. I feel that it is because of the median.
Based on the answer by @d.b I used the following R Code. :
ggplot(dataForGraph, aes(x = factor(NUM_FLOORS), y = AV_BLDG)) + geom_bar(stat = "summary", fun.y = "median") + scale_y_continuous(labels=fancy_scientific)
I got this graph
Now I want to add color gradient (light blue too dark) dark for large value and light for low. Can anybody help me in the same?
Thanks