Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.21.0110181620460.14941-100000@artemis.imbe.med.uni-erlangen.de>
Date: 2001-10-18T14:24:54Z
From: Torsten Hothorn
Subject: vectors / matrices

Hi, 

a friend of mine came across this

R> x <- 1:5
R> cbind(x,x)
     x x
[1,] 1 1
[2,] 2 2
[3,] 3 3
[4,] 4 4
[5,] 5 5
R> rbind(x,x)
  [,1] [,2] [,3] [,4] [,5]
x    1    2    3    4    5
x    1    2    3    4    5


x is a vector and therefore has no dim-attribute. Obviously cbind treats x
as a col-vector but rbind treats x as a row-vector, that is: two
functions have a different view on x. I'm sure there is a
good reason for this but I could not find it ...

Torsten

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._