[R] learning R
dwinsemius at comcast.net
Wed Feb 25 06:17:33 CET 2009
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?
> 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)
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 3 4 5
More information about the R-help