Using cbind on an arbitrarily long list of objects

前端 未结 4 815
悲哀的现实
悲哀的现实 2020-11-29 09:03

I would like to find a way to create a data.frame by using cbind() to join together many separate objects. For example, if A, B, C & D are all vectors of eq

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-29 09:48

    You can put all vectors in environment into list using eapply.

    obj.list <- eapply(.GlobalEnv,function(x) if(is.vector(x)) x)
    obj.list <- obj.list[names(obj.list) %in% LETTERS]
    

提交回复
热议问题