For the default split of "
, assumes that each element of lines
has the same number of characters.
Value
A matrix where the number of rows is the length of lines
and, for a split on "
, the number of columns is the same as the number of characters in each element of lines
.
Examples
lines_to_matrix(c("#.#.", "..#.", "##.."))
#> [,1] [,2] [,3] [,4]
#> [1,] "#" "." "#" "."
#> [2,] "." "." "#" "."
#> [3,] "#" "#" "." "."