I can not find the documentation for the double dots around density
set.seed(1234)
df <- data.frame(cond = factor(rep(c("A","B"), each=200)), rating = c(rnorm(200),rnorm(200, mean=.8)))
print(head(df))
print(ggplot(df, aes(x=rating)) +
geom_histogram(aes(y=..density..), # Histogram with density instead of count on y-axis
binwidth=.5,
colour="black", fill="white") +
geom_density(alpha=.2, fill="#FF6666") +
geom_vline(aes(xintercept=mean(rating, na.rm=T)), # Ignore NA values for mean
color="red", linetype="dashed", size=1))
Do you know what operator they represent ?
Edit
I know what it does when used in a geom, I would like to know what it is. For instance, the single dot operator is defined as
> .
function (..., .env = parent.frame())
{
structure(as.list(match.call()[-1]), env = .env, class = "quoted")
}
<environment: namespace:plyr>
If I redefine density, then ..density.. has a different effect, so it seems XX -> ..XX.. is an operator. I would like to find how it is defined.
ggpolot2
to do it's own internal computation of the value rather than look for the value in the workspace. – Anesthetizeggplot2
to find the exact definition/mechanism. – Anesthetize?stat_bin
provides no insight to this question – Tutu..var..
variables are superseded by theafter_stat()
function. – Rivulet