[R] using MAP and PURR to compute characteristic roots

Veerappa Chetty chettyvk @end|ng |rom gm@||@com
Thu Apr 1 02:10:29 CEST 2021


I have to compute characteristic roots for 100s of U.S.counties.  I got
help using " lapply". I prefer using MAP and PURR if that is possible. I am
using them to compute linear regressions.
Here is my test problem and the output. I would appreciate any help.
Thanks
V.K.Chetty
____
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(data.matrix(x)), data=.))

I get this output:
> test.out$fit
[[1]]
function(x) eigen(data.matrix(x))
<environment: 0x0000017d35f00518>

[[2]]
function(x) eigen(data.matrix(x))
<environment: 0x0000017d35ef73d0>

	[[alternative HTML version deleted]]



More information about the R-help mailing list