Character vector to matrix

chr_to_matrix(x, value = 0)

Arguments

x

character vector

value

value in matrix

Details

creates square matrix with x as row and column names and val as values

Examples


d1 <- letters[1:3]
chr_to_matrix(d1, 3:5)
#>   a b c
#> a 3 3 3
#> b 4 4 4
#> c 5 5 5