Skip to content
Back to formatted view

Raw Message

Message-ID: <x2he998955.fsf@biostat.ku.dk>
Date: 2003-04-08T12:29:42Z
From: Peter Dalgaard
Subject: Scalar vs. vector
In-Reply-To: <5.2.0.9.2.20030407075040.00b675c8@postoffice.pacbell.net>

Chris Fehily <fehily at pacbell.net> writes:

> Do these statements yield identical types of objects?
>    x = 3
> and
>    y = c(3)
> 
> That is, intrinsically, is x, like y, a vector of length one, but
> created with abbreviated syntax?

No, y is like x, a vector of length one, only created with an overly
long-winded syntax... 

(c() is for *concatenation*)

> More simply: Are scalars really trivial vectors?

Yes.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907