I want to use map and purr functions to compute eigen values for 3000 matrices. Each matrix has 2 rows and 2 columns. The following code does not work.
test.dat<- tibble(ID=c(1,2),a=c(1,1),b=c(1,1),c=c(2,2),d=c(4,3)) test.out<-test.dat %>% nest(-ID) %>% mutate(fit = purrr::map(data,~ function(x) eigen(matrix(x,2,2)), data=.)) This must be a trivial question for current young practitioners ( In my 9 th decade, I am having fun using R markdown and I am trying to continue my research!) I would greatly appreciate any help. Thanks. V.K.Chetty -- Professor of Family Medicine Boston University [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.