How to name a dataframe so that I can look for it within a list

筅森魡賤 提交于 2019-12-08 19:45:32

How about this?

mapply(
  function(x,y){
    data.frame(y+1) %>% setNames(., x)
    }, 
  c("a", "b", "c"), 1:3, USE.NAMES = T, SIMPLIFY = F)

Output is:

$a
  a
1 2

$b
  b
1 3

$c
  c
1 4

@DavisVaughan provided the solution https://github.com/DavisVaughan/furrr/issues/10

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!