hist(faithful$waiting) par(mfrow=c(3,1)) hist(faithful$ eruptions) hist(faithful$eruptions, density =-1) hist(faithful$eruptions,probability=T) par(mfrow=c(3,1)) hist(faithful$ eruptions,nclass=nclass.Sturges) hist(faithful$ eruptions,nclass=nclass.scott) hist(faithful$ eruptions,nclass=nclass.FD) ******************************ME DA LO MISMO EN LOS TRES!!!!******************** ****** Con este 2 dan distinto***************** x=rexp(30,1) hist(x,breaks="Sturges") hist(x,breaks="scott") hist(x,breaks="fd") ******* Pongo distintos puntos de corte****** eru=faithful$eruptions summary(eru) Min. 1st Qu. Median Mean 3rd Qu. Max. 1.600 2.163 4.000 3.488 4.454 5.100 > 5.2-1.5 [1] 3.7 > 5.1-1.6 [1] 3.5 > corte=seq(1.6,5.1,0.7) > corte [1] 1.6 2.3 3.0 3.7 4.4 5.1 hist(eru,breaks=corte) corte2=seq(1.6,5.1,0.5) hist(eru,breaks=corte2) corte3=c(1.6,2.6,4,4.5,5.1) ****** cuando los intervalos son de distinta longitud hace el hist correcto*** hist(eru,breaks=corte3) hist(eru,breaks=corte3,probability=T) ***** Pongo tětulos y colores***************** hist(eru, breaks = corte2, col = "green", border = NULL, main = "Histograma Erupciones") hist(eru, breaks = corte2, col = 280, border = NULL, main = "Histograma Erupciones") h ****** Para saber cuantos colores hay******************** ****** Los puedo poner por color entre comillas o por nůmero***************** col=colours() length(col) [1] 657 hist(eru, breaks = corte2, col = "blue", border = NULL,probability=T, main = "Histograma",ylab="Frecuencias Relativas", xlab=" Erupciones volcŕnicas") lines(density(eru),col="red") *** Ver ****density(eru)