-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Description
Hi,
The error message for geom_density() when using x and y comes up and says y is missing. My suggestion would be to change the error when x and y are present but stat is not identity to "y is present, did you mean to use stat = 'identity'" or something like that. Also adding an example that uses x and y to https://ggplot2.tidyverse.org/reference/geom_density.html would be great.
x<-data.frame(value=seq(0,1,by=0.2), count=rnorm(6, mean = 10) )
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 3.6.1
ggplot(x)+geom_density(aes(x=value, y=count))
#> Error: geom_density requires the following missing aesthetics: y
ggplot(x)+geom_density(aes(x=value, y=count), stat = 'identity')
Created on 2019-09-02 by the reprex package (v0.3.0)
francisbarton
Metadata
Metadata
Assignees
Labels
No labels