###otro problema
Grillos <- c(4.3, 3.9, 17.4, 2.3, 0.8, 1.5,
+ 0.7, 3.7, 24.1, 9.4, 5.6, 3.7, 5.2,
+ 3.9, 4.2, 3.5, 6.6, 6.2, 2.0, 0.8,
+ 2.0, 3.7, 4.7, 7.3, 1.6, 3.8, 0.5,
+ 0.7, 4.5, 2.2, 4.0, 6.5, 1.2, 4.5,
+ 1.7, 1.8, 1.4, 2.6, 0.2, 0.7, 11.5,
+ 5.0, 1.2, 14.1, 4.0, 2.7, 1.6, 3.5,
+ 2.8, 0.7, 8.6)
#ordenar:
sort(Grillos)
## [1] 0.2 0.5 0.7 0.7 0.7 0.7 0.8 0.8 1.2 1.2 1.4 1.5 1.6 1.6 1.7
## [16] 1.8 2.0 2.0 2.2 2.3 2.6 2.7 2.8 3.5 3.5 3.7 3.7 3.7 3.8 3.9
## [31] 3.9 4.0 4.0 4.2 4.3 4.5 4.5 4.7 5.0 5.2 5.6 6.2 6.5 6.6 7.3
## [46] 8.6 9.4 11.5 14.1 17.4 24.1
sink()
#Esta funcion es para ordenarlos de mayor a menor
sort(Grillos,decreasing = T)
## [1] 24.1 17.4 14.1 11.5 9.4 8.6 7.3 6.6 6.5 6.2 5.6 5.2 5.0 4.7 4.5
## [16] 4.5 4.3 4.2 4.0 4.0 3.9 3.9 3.8 3.7 3.7 3.7 3.5 3.5 2.8 2.7
## [31] 2.6 2.3 2.2 2.0 2.0 1.8 1.7 1.6 1.6 1.5 1.4 1.2 1.2 0.8 0.8
## [46] 0.7 0.7 0.7 0.7 0.5 0.2
length(Grillos)
## [1] 51
#Cuantas veces se repite un valor
table(Grillos)
## Grillos
## 0.2 0.5 0.7 0.8 1.2 1.4 1.5 1.6 1.7 1.8 2 2.2 2.3 2.6 2.7 2.8
## 1 1 4 2 2 1 1 2 1 1 2 1 1 1 1 1
## 3.5 3.7 3.8 3.9 4 4.2 4.3 4.5 4.7 5 5.2 5.6 6.2 6.5 6.6 7.3
## 2 3 1 2 2 1 1 2 1 1 1 1 1 1 1 1
## 8.6 9.4 11.5 14.1 17.4 24.1
## 1 1 1 1 1 1
mean(Grillos)
## [1] 4.335294
#con esto redondeamos a dos decimales
round(mean(Grillos), 2)
## [1] 4.34
median(Grillos)
## [1] 3.7
var(Grillos)
## [1] 19.64793
sd(Grillos)
## [1] 4.432598
sqrt(var(Grillos))
## [1] 4.432598
var(Grillos)
## [1] 19.64793
round(var(Grillos), 2)
## [1] 19.65
summary(Grillos)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.200 1.600 3.700 4.335 4.850 24.100
quantile(Grillos, 0.25)
## 25%
## 1.6
quantile(Grillos, 0.75)
## 75%
## 4.85
Grillos
## [1] 4.3 3.9 17.4 2.3 0.8 1.5 0.7 3.7 24.1 9.4 5.6 3.7 5.2 3.9 4.2
## [16] 3.5 6.6 6.2 2.0 0.8 2.0 3.7 4.7 7.3 1.6 3.8 0.5 0.7 4.5 2.2
## [31] 4.0 6.5 1.2 4.5 1.7 1.8 1.4 2.6 0.2 0.7 11.5 5.0 1.2 14.1 4.0
## [46] 2.7 1.6 3.5 2.8 0.7 8.6
hist (Grillos,
main = expression("Duracion de canciones fallidas en * Anabrus Simplex (n=51)"),
xlab="Duracion (segundos)",
ylab="Frecuencia",
col="blue")
HOLA COMO ESTAS