G'day Erin,

On Thu, 23 Apr 2015 20:51:18 -0400
Erin Hodgess <erinm.hodg...@gmail.com> wrote:

> Here is the big picture.  I have a character vector with all of the
> names of the variables in it.
> 
> I want to "cbind" all of the variables to create a matrix.
> 
> Doing 3 is straightforward, but many, not so much.

So I guess you want something like:

R> do.call(cbind, sapply(big.char, as.name))
     dog cat tree
[1,]   1   2    5
[2,]   2   3    6
[3,]   3   4    7

Which does not seem to have the problem of confusing the numeric vector
`cat' with the function 'cat'.

HTH.

Cheers,

        Berwin

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to