I would like to have a list of matrices within R imported from a json file using jsonlite.
A <- matrix(rnorm(100),10,10)
B <- matrix(rnorm(100),10,10)
C <- matrix(rnorm(100),10,10)
l <- list(A,B,C)
import_l <- fromJSON(toJSON(l),simplifyMatrix = FALSE)
the above code doesnt work since it is R internally a list of list of numerics. However, I would like to have my list of A,B,C
back, i.e. l
. Is there a way to achieve getting back the correct list of matrices using jsonlite?