Revert list structure

前端 未结 6 757
梦如初夏
梦如初夏 2020-12-24 02:26

GOAL

Given a list of lists my goal is to reverse its structure (R language).

So, I want to bring the elements of the nested lists to be el

6条回答
  •  清酒与你
    2020-12-24 03:03

    reshape can get you close,

    library(reshape)
    b = recast(z, L2~L1)
    split(b[,-1], b$L2)
    

提交回复
热议问题