Hi, I am trying to draw a histogram in ggplot, but my data does not have all the values, but the values ββand the number of occurrences.
value=c(1,2,3,4,5,6,7,8,9,10) weight<-c(8976,10857,10770,14075,18075,20757,24770,14556,11235,8042) df <- data.frame(value,weight) df value weight 1 1 8976 2 2 10857 3 3 10770 4 4 14075 5 5 18075 6 6 20757 7 7 24770 8 8 14556 9 9 11235 10 10 8042
Does anyone know how to align values ββor how to plot a histogram of binn values.
I want to get what will look like
bin weight 1 1-2 19833 2 3-4 24845 ...
source share