Bruce,
With what you're doing, you should be seeing a confusing error message in the JGR console whenever you try to plot that code. The upshot is that you need to set stat="identity" for geom_bar() (in the drop-down menu above the "mappings" tab) in order to treat your x variable as location of bins and y variable as the count/density/frequency within each bin.
df <- data.frame(x = c(0, 0.5, 1, 1.5, 2, 2.5), y = c(1, 2, 3, 4, 3, 2))
ggplot() +
geom_bar(aes(x = x,y = y),data=df,stat = 'identity')
Once you've done this, you cannot control bin width, because you've implicitly specified the bin widths with your x variable.
If you want to control bin width from within the ggplot2 call, you need your x variable to represent individual observations that can be summarized into counts within bins.
df2 <- data.frame(x = rnorm(100))
ggplot() +
geom_histogram(aes(y = ..count..,x = x),data=df2,binwidth = 0.5)
Here, I've explicitly included "y = ..count..", which is normally the default in geom_histogram() and not displayed in the call printed out by Deducer's "View call" command.
Regards,
Tom