Problems with accessing double elements in a list in R

前端 未结 2 355
时光说笑
时光说笑 2021-01-28 03:58

I have performed a bootstrapping with 2.000 resamples of the Lee Carter model for mortality projection. The question is not specific for mortality studies, but on more general d

相关标签:
2条回答
  • 2021-01-28 04:37

    You may want to have a look at the purrr package and the family of map functions, or tidyr and the hoist funtion.

    (If you want code that works, you indeed need to provide some data!)

    0 讨论(0)
  • 2021-01-28 04:45

    It looks like you need the apply family of functions. Your data is not reproducible, so I can't confirm this will work, but if you do:

    result <- sapply(JA_lc_fitM_boot1[["bootParameters"]], function(var) var[["bx"]][[70]])
    

    You should get what you're looking for.

    0 讨论(0)
提交回复
热议问题