Autores
-Rene Avila
-Michael Chacaguasay
-Johann Tul
-Bryan Venegas
num1 <- 0.3*0.15
num2 <- 0.3*0.15
num3 <- 0.2*0.8
num4 <- 0.5*0.12
total <- num1/(num2+num3+num4)
total
## [1] 0.1698113
num5 <- (5^6)/(factorial(6))
num6 <- exp(-5)
total2 <- num5*num6
total2
## [1] 0.1462228
vector1 <- (1000*(1000+1))/2
vector1
## [1] 500500
vector2 <- rep(vector1, time=2)
vector2
## [1] 500500 500500
vector4 <- 1
vector5 <- 2
for(i in 1:10)
{
vector4<-vector4+(vector5^i)
}
vector6 <- rep(vector4, time=2)
vector6
## [1] 2047 2047
nombres <- c("PAULA","PABLO","DILAN","DAVID","PEDRO","SOFIA","SARA","MIGUEL",
"CARLA","DANIELA","LUIS","JONATHAN","PAMELA","CARLOS","FATIMA",
"ALEJANDRO","SEBASTIAN","MARIA","JUAN","RAQUEL")
nombres
## [1] "PAULA" "PABLO" "DILAN" "DAVID" "PEDRO" "SOFIA"
## [7] "SARA" "MIGUEL" "CARLA" "DANIELA" "LUIS" "JONATHAN"
## [13] "PAMELA" "CARLOS" "FATIMA" "ALEJANDRO" "SEBASTIAN" "MARIA"
## [19] "JUAN" "RAQUEL"
length(nombres)
## [1] 20
which(nombres=="ALEJANDRO",arr.ind=TRUE )
## [1] 16
nexamen <- c(4,6,3,8,10,7,4,8,9,10,10,5,8,7,4,1,2,5,8,9)
nexamen
## [1] 4 6 3 8 10 7 4 8 9 10 10 5 8 7 4 1 2 5 8 9
length(nexamen)
## [1] 20
sum(nexamen)
## [1] 128
mean(nexamen)
## [1] 6.4
which(nexamen >=7)
## [1] 4 5 6 8 9 10 11 13 14 19 20
sort(nexamen)
## [1] 1 2 3 4 4 4 5 5 6 7 7 8 8 8 8 9 9 10 10 10
sort(nexamen,decreasing = T)
## [1] 10 10 10 9 9 8 8 8 8 7 7 6 5 5 4 4 4 3 2 1
max(nexamen)
## [1] 10
maxi <- max(nexamen)
maxi
## [1] 10
which(nexamen %in% c(maxi))
## [1] 5 10 11
nexamen[1:10]
## [1] 4 6 3 8 10 7 4 8 9 10
sum(nexamen[1:10])
## [1] 69
length(nombres)
## [1] 20
sum(nexamen)
## [1] 128
posición <- which(nexamen>=7)
posición
## [1] 4 5 6 8 9 10 11 13 14 19 20
totalp <- length(posición)
totalp
## [1] 11
porcentaje<-(totalp*100)/length(nombres)
porcentaje
## [1] 55
max(nexamen)
## [1] 10
min(nexamen)
## [1] 1
m <- data.frame(nombres = c("PAULA","PABLO","DILAN","DAVID","PEDRO","SOFIA","SARA","MIGUEL",
"CARLA","DANIELA","LUIS","JONATHAN","PAMELA","CARLOS","FATIMA",
"ALEJANDRO","SEBASTIAN","MARIA","JUAN","RAQUEL"), nexamen = c(4,6,3,8,10,7,4,8,9,10,10,5,8,7,4,1,2,5,8,9) )
m
## nombres nexamen
## 1 PAULA 4
## 2 PABLO 6
## 3 DILAN 3
## 4 DAVID 8
## 5 PEDRO 10
## 6 SOFIA 7
## 7 SARA 4
## 8 MIGUEL 8
## 9 CARLA 9
## 10 DANIELA 10
## 11 LUIS 10
## 12 JONATHAN 5
## 13 PAMELA 8
## 14 CARLOS 7
## 15 FATIMA 4
## 16 ALEJANDRO 1
## 17 SEBASTIAN 2
## 18 MARIA 5
## 19 JUAN 8
## 20 RAQUEL 9
which(nexamen ==10)
## [1] 5 10 11
m[10,]
## nombres nexamen
## 10 DANIELA 10
aprobados <- c(8,10,7,8,9,10,10,8,7,8,9)
aprobados
## [1] 8 10 7 8 9 10 10 8 7 8 9
mean(aprobados)
## [1] 8.545455