1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| matrice_A <- matrix(c("A", "B", "C",
"A", "B", "C"),
nrow = 2, ncol = 3, byrow = TRUE)
matrice_A
#> [,1] [,2] [,3]
#> [1,] "A" "B" "C"
#> [2,] "A" "B" "C"
matrice_B <- matrix(c(1, 1, 1,
2, 2, 2),
nrow = 2, ncol = 3, byrow = TRUE)
matrice_B
#> [,1] [,2] [,3]
#> [1,] 1 1 1
#> [2,] 2 2 2
matrice_C <- matrix(paste0(matrice_A, matrice_B),
nrow = 2, ncol = 3, byrow = TRUE)
matrice_C
#> [,1] [,2] [,3]
#> [1,] "A1" "A2" "B1"
#> [2,] "B2" "C1" "C2"
# Created on 2020-11-26 by the reprex package (v0.3.0.9001) |