che sto cercando di fare un istogramma in [R], e la curva normale che descrive l'istogramma come segue:Come utilizzare la curva di funzione in [R] per rappresentare graficamente una curva normale?
w<-rnorm(1000)
hist(w,col="red",freq=F,xlim=c(-5,5))
curve(dnorm(w),-5,5,add=T,col="blue")
Ma quando provo a tracciare la curva normale funzione curva mi mostra il seguente errore :
Error en curve(dnorm(w), -5, 5, add = T, col = "blue") :
'expr' must be a function, or a call or an expression containing 'x'
Cosa sto facendo male?
try 'linee (densità (w))' ' –