I was thinking to use assign as in the following code. Perhaps I misunderstood.
keys <- paste0("PL050", 1:4)
keys
#> [1] "PL0501" "PL0502" "PL0503" "PL0504"
for (i in 1:4) {
x = matrix(i, ncol = i, nrow = i)
assign(keys[i], x)
}
print(PL0503)
#> [,1] [,2] [,3]
#> [1,] 3 3 3
#> [2,] 3 3 3
#> [3,] 3 3 3
print(PL0502)
#> [,1] [,2]
#> [1,] 2 2
#> [2,] 2 2
Created on 2020-10-15 by the reprex package (v0.3.0)