I request for the nested data frame to be able to store matrix in a column.
Following code will create a column "tensor" whose type of element is <list [3 x 3]> (not matrix).
To apply set of matrices the same operations, It will be easy to manupulate if nested data frame can store matrix. (And also map function to return matrix will be necessary.)
data <- data %>%
select(nodeid,
sxx, syx, szx, sxy, syy, szy, sxz, syz, szz)
data %>%
group_by(nodeid) %>%
nest(.key = "tensor") %>%
mutate(tensor = map(tensor, ~ matrix(., nrow = 3)))