문제

I have a list in R looks like, mylist$a, mylist$b, mylist$c, ..., mylist$z. Is there a easier way to combine all those fields of the list into one variable rather then typing a command like cbind(mylist$a,mylist$b,...,mylist$z)?

P.S. All sub-fields has the same dimension.

도움이 되었습니까?

해결책

do.call() calls its first arguments with all the elements in the second argument:

do.call(cbind, mylist)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top