[R] dim enquiry

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Feb 17 16:23:24 CET 1999


Jonathan Rougier <J.C.Rougier at durham.ac.uk> writes:

> This is a minor question, but is there any difference between the two
> objects
> 
> fred <- structure(1:10, dim = c(2,5))
> 
> and
> 
> fred <- structure(1:10, .Dim = c(2,5))

No:

R> dput(structure(1:10, dim = c(2,5)))
structure(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), .Dim = c(2, 5))
R> dput(structure(1:10, .Dim = c(2,5)))
structure(c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), .Dim = c(2, 5))

> Should I be using one rather than the other?  Thanks, Jonathan.

I think the dim= form is marginally better. .Dim gets internally
converted to dim anyway. (But don't ask me why dput represents it
using .Dim...)

-- 
   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
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list