I have a character matrix (3 x 2) that looks as follows:
“A” “1”
“B” “1”
“C” “2”
Both columns are text strings. I would like to convert this matrix to a new matrix (4 x 2) that looks as follows:
“A” 1
“B” 1
“C” 1
“C” 1
Essentially, because the initial row 3 has the number two at the end, it means that string C must be repeated twice in the new matrix. I would also like to convert column 2 from text to numeric.
What would be the quickest and most efficient way to do this? I have a dataset that is over 2m lines long, so I need something that is robust but also quick to "expand" the matrix accordingly.
Thanks!