Vamos a realizar una prueba markdown
Esto es negrita negrita seguimos
Lista de elementos
# Aqui es donde va el código R
edades <- c(50, 34, 45, 35, 38, 36, 29, 43, 40, 28, 28, 30, 28, 45)
nombres <- c("Rubén", "Dany", "Alma", "Carlos",
"Daniel", "Dell", "Francisco",
"Isaac", 'Javier', 'Jesús', "Laura",
"Luis", "Maria", "Verenice")
edades
## [1] 50 34 45 35 38 36 29 43 40 28 28 30 28 45
nombres
## [1] "Rubén" "Dany" "Alma" "Carlos" "Daniel" "Dell"
## [7] "Francisco" "Isaac" "Javier" "Jesús" "Laura" "Luis"
## [13] "Maria" "Verenice"
length(edades)
## [1] 14
length(nombres)
## [1] 14
nombres
## [1] "Rubén" "Dany" "Alma" "Carlos" "Daniel" "Dell"
## [7] "Francisco" "Isaac" "Javier" "Jesús" "Laura" "Luis"
## [13] "Maria" "Verenice"
nombres[3]
## [1] "Alma"
nombres[1:4]
## [1] "Rubén" "Dany" "Alma" "Carlos"
nombres[-1]
## [1] "Dany" "Alma" "Carlos" "Daniel" "Dell" "Francisco"
## [7] "Isaac" "Javier" "Jesús" "Laura" "Luis" "Maria"
## [13] "Verenice"
nombres[c(2, 4, 6, 8, 10, 12, 14)]
## [1] "Dany" "Carlos" "Dell" "Isaac" "Jesús" "Luis" "Verenice"
typeof(edades)
## [1] "double"
typeof(nombres)
## [1] "character"
1:4 #Secuencia de 1 a 4
## [1] 1 2 3 4
seq(1,100)
## [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
## [19] 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
## [37] 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
## [55] 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
## [73] 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
## [91] 91 92 93 94 95 96 97 98 99 100
seq(-10, 10)
## [1] -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8
## [20] 9 10
seq(-0.5, 0.5, 0.1)
## [1] -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5
seq(from=-0.5, to = 0.5, by = 0.1) # La misma que 89
## [1] -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5
head(seq(1, 100000, 0.5)) # Solo los primeros seis
## [1] 1.0 1.5 2.0 2.5 3.0 3.5
tail(seq(1, 100000, 0.5)) # Los últimos seis
## [1] 99997.5 99998.0 99998.5 99999.0 99999.5 100000.0
length(seq(0.5, 100000, 0.5)) # 200000
## [1] 200000
rep(4, 6) # Repite el 4 seis veces
## [1] 4 4 4 4 4 4
rep("Rubén", 10)
## [1] "Rubén" "Rubén" "Rubén" "Rubén" "Rubén" "Rubén" "Rubén" "Rubén" "Rubén"
## [10] "Rubén"
rep(1:5, 3)
## [1] 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
length(rep(1:5, 3))
## [1] 15
rep(seq(2,100,2), 5)
## [1] 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36
## [19] 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68 70 72
## [37] 74 76 78 80 82 84 86 88 90 92 94 96 98 100 2 4 6 8
## [55] 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44
## [73] 46 48 50 52 54 56 58 60 62 64 66 68 70 72 74 76 78 80
## [91] 82 84 86 88 90 92 94 96 98 100 2 4 6 8 10 12 14 16
## [109] 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52
## [127] 54 56 58 60 62 64 66 68 70 72 74 76 78 80 82 84 86 88
## [145] 90 92 94 96 98 100 2 4 6 8 10 12 14 16 18 20 22 24
## [163] 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60
## [181] 62 64 66 68 70 72 74 76 78 80 82 84 86 88 90 92 94 96
## [199] 98 100 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32
## [217] 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 64 66 68
## [235] 70 72 74 76 78 80 82 84 86 88 90 92 94 96 98 100
numeros <- c(4,5,6,7,6,5,4,5,9)
numeros * 2
## [1] 8 10 12 14 12 10 8 10 18
numeros ^ 3
## [1] 64 125 216 343 216 125 64 125 729
numeros
## [1] 4 5 6 7 6 5 4 5 9
sort(numeros)
## [1] 4 4 5 5 5 6 6 7 9
sort(numeros, decreasing = TRUE)
## [1] 9 7 6 6 5 5 5 4 4
numeros
## [1] 4 5 6 7 6 5 4 5 9
length(numeros)
## [1] 9
numeros <- c(numeros, 2,6,5,7,8,9)
numeros
## [1] 4 5 6 7 6 5 4 5 9 2 6 5 7 8 9
length(numeros)
## [1] 15
barplot(edades, names.arg = nombres,
main = "Edades de los participantes",
xlab = "Nombres", ylab = "Edades")