I have a table with 1 column as a factor with 5 levels. I am extracting the unique factors set into a new data table TNAME and then want to put TNAME into a list and add a reference value 1-5 so essentially a matrix of 5x2 dimensions. How do I do this in R?
I tried:
list1 = list(split(TNAME, seq(nrow())), 1:5)
But that did not given me the intended result which looks below:
[,1] [,2]
[1,] "a""1"
[2,] "b""2"
[3,] "c""3"