Message-ID: <303D9ED9-CD02-4D04-A49E-12A8040A9F4E@comcast.net>
Date: 2009-02-25T05:17:33Z
From: David Winsemius
Subject: learning R
In-Reply-To: <6E853AE7-8581-4EF1-B64A-A351AA96D79B@comcast.net>
On Feb 25, 2009, at 12:12 AM, David Winsemius wrote:
>
> On Feb 24, 2009, at 11:36 PM, Fuchs Ira wrote:
>
>>
>
>
>>
>> also unrelated: if I have two vectors and I want to combine them
>> to form a matrix ,is cbind (or rbind) the most direct way to do this?
>>
>> e.g.
>>
>> x=c(1,2,3)
>> y=c(3,4,5)
>> z=rbind(x,y)
>
> That is ok. Also effective would be:
>
> z <- matrix( c(x,y), ncol=length(x) )
>>
Would need byrow=TRUE for that to behave as desired.
> z <- matrix(c(x,y), 2.3, byrow=TRUE)
> z
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 3 4 5
--
David Winsemius