Skip to content
Prev 350340 / 398506 Next

cbind question, please

You could do something tricky like
  > do.call(cbind, lapply(big.char, as.name))
       dog cat tree
  [1,]   1   2    5
  [2,]   2   3    6
  [3,]   3   4    7
but you are usually better off creating these things as part of a list
and passing that to do.call(cbind, list).

There is a slight danger of using do.call with cbind.  If your
list has a component with the unlikely name 'deparse.level',
then that will be taken as cbind's deparse.level argument,
not as a column of the matrix to be made.


Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Thu, Apr 23, 2015 at 3:41 PM, Erin Hodgess <erinm.hodgess at gmail.com>
wrote: