I know how to change the default colour in bar charts blue
update_geom_defaults("bar", list(fill = "blue"))
but how do I change the stat component. I tried
update_geom_defaults("bar", list(stat = "identity"))
but after I attempt a ggplot() + geom_bar(...) I get the error message Mapping a variable to y and also using stat="bin". How do I actually change the defaults?
I noticed that
> update_geom_defaults
function (geom, new)
{
g <- Geom$find(geom)
old <- g$default_aes()
aes <- defaults(new, old)
g$default_aes <- eval(substitute(function(.) aes, list(aes = aes)))
}
<environment: namespace:ggplot2>
seems to only apply the update to aesthetics.