I found this expression while working on ggplot.
qplot(carat, ..density.., data = diamonds, facets = color ~ ., geom = "histogram", binwidth = 0.1, xlim = c(0, 3))
How is ..density..
interpreted by R?
Clearly it is not a variable and it is processed inside the function to convey that we want to use the density but I would like to undertand how it works at the language level.
Normally, aesthetics are a 1:1 mapping to a column in the input data.frame. In this case, density is an output of the binning for the histogram. So, this the ggplot2 way of referring to certain derivatives that are a by product of an aggregation, such as the binning for a histogram in this case.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With