I want to plot two continuous variables using ggplot. Assume I have a dataframe where one column is a ratio between 0 and 1, and the other one is an amount. I want to by able to have a break of the ratio in the x axis using something like
breaks=seq(0, 5, by = .1)
and in the y axis I want to have the sum of the amount for each break. It would be look like a histogram but the y axis should be the sum of all columns within the break ratio. If I was making a histogram, it would look like this:
ggplot(data=data, aes(ratio)) +
geom_histogram(breaks=seq(0, 1, by = .1), aes(fill=..count..))