Skip to content
Back to formatted view

Raw Message

Message-ID: <5539F1AB.9090105@uni-bayreuth.de>
Date: 2015-04-24T07:32:59Z
From: David Kienle
Subject: cbind question, please
In-Reply-To: <CACxE24nfuh+JWDqiGOrTJ81UbdoyWJQEScPB95Kzuxy5KstuAg@mail.gmail.com>

Hello Erin,

I think you have explain your goal more detailed. Maybe I am completely 
lost but as far as I understand now you only need the command cbind:

m1 <- cbind(dog, dat, tree)

  dog cat tree
[1,]   1   2    5
[2,]   2   3    6
[3,]   3   4    7

But I can't imagine that is the solution you are looking for.

Cheers
David


On 24.04.2015 00:41, Erin Hodgess wrote:
> Hello!
>
> I have a cbind type question, please:  Suppose I have the following:
>
> dog <- 1:3
> cat <- 2:4
> tree <- 5:7
>
> and a character vector
> big.char <- c("dog","cat","tree")
>
> I want to end up with a matrix that is a "cbind" of dog, cat, and tree.
> This is a toy example.  There will be a bunch of variables.
>
> I experimented with "do.call", but all I got was
> 1
> 2
> 3
>
> Any suggestions would be much appreciated.  I still think that do.call
> might be the key, but I'm not sure.
>
> R Version 3-1.3, Windows 7.
>
> Thanks,
> Erin
>
>

-- 
David Kienle

Department of Biogeography
University of Bayreuth

GEO II, Rm 003