#Cargamos nuestros datos
<- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ,11, 12 ,13, 14 , 15, 16, 17, 18, 19, 20, 21, 22 , 23, 24, 25, 26)
mi_diccionario mi_diccionario
[1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
[26] 26
Creando un diccionario vamos a tener una serie de valores asociados a unas claves
#Cargamos nuestros datos
<- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ,11, 12 ,13, 14 , 15, 16, 17, 18, 19, 20, 21, 22 , 23, 24, 25, 26)
mi_diccionario mi_diccionario
[1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
[26] 26
#Asociamos a un nombre
names(mi_diccionario)<- c("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")
#Comprobamos el valor de la clave
"a"] mi_diccionario[
a
1
"m"] mi_diccionario[
m
13
"z"] mi_diccionario[
z
26
#Obtener la lista de pares clave y valor
mi_diccionario
a b c d e f g h i j k l m n o p q r s t u v w x y z
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26