Density Plot con R. Por qué los valores en el eje vertical Y son mayores de 1? Hay algo mal en mi código?
Supongo que como los valores de probabilidad no pueden ser mayores a 1, algo debería estar mal. Pero, no estoy seguro. Pueden revisar el código y aclararme mi duda?
library(datasets)
str(iris)
library(ggplot2)
theme_set(theme_classic())
# Plot
g <- ggplot(iris, aes(x=Petal.Length, fill=Species))
myDensityPlotWithGGplot <- g + geom_density() +
labs(title="Density plot",
subtitle="Petal Length by Species",
caption="Source: Iris Set",
x="Petal Length",
fill="Species")
myDensityPlotWithGGplot
library(plotly)
myDensityPlotWithPLOTLY <- ggplotly(myDensityPlotWithGGplot)
myDensityPlotWithPLOTLY