I want to add a new column to an existing tibble, and each element of the new column is a matrix. Here is what I did,
Add it to the tibble WY_reg
using list
WY_reg <- WY_reg %>%
add_column(NewMat = list(Mat1, Mat2,Mat3) )
That indeed adds a new column. However, it seems that when I execute WY_reg$NewMat[1]
, it returns a list, rather than a matrix, so that I cannot do usual matrix operations.
I also tried as.matrix
but fails.
Is there any way I can put a new column and each element is a matrix? so that they can involve later operations? Thanks