Skip to content

How to force a vector to be column or row vector?

2 messages · Liaw, Andy, Gabor Grothendieck

#
From: Gabor Grothendieck
The c() is not needed above.

Also, this might be a better way of computing a quadratic form:
[,1]
[1,]  202
[,1]
[1,]  202

In R, it usually makes little difference whether a vector is row-vector or
column-vector.

Andy
#
On 2/2/06, Liaw, Andy <andy_liaw at merck.com> wrote:
The poster asked for an expression that would work "regardless of
the original form" of the vector -- row, column or neither.  The c
gets it into a known form first.  For example:
[,1] [,2] [,3]
[1,]    1    1    1