R-alpha: loss of matrix attributes

Colin Farrow (colin@geology.gla.ac.uk)
Tue, 3 Sep 1996 15:52:04 +0100


Message-Id: <17864.199609031452@slioch.geology.gla.ac.uk>
Date: Tue, 3 Sep 1996 15:52:04 +0100
From: Colin Farrow <colin@geology.gla.ac.uk>
To: r-testers@stat.math.ethz.ch
Subject: R-alpha: loss of matrix attributes


In order to give R a test drive on a current problem I dump()'ed a list
from S into a file, and then source()'ed it into R-0.10.

Problem: Matrix objects are not restored correctly, they appear as a
vector, with attributes .Dim and .Dimnames. R uses attributes dim and
dimnames.

Whilst investigating that problem I also found another with dput() and
dump(), both of which lose the matrix attributes


eg

> x
[[1]]
[1] 1 2 3 4 5

[[2]]
  a b
a 1 1
b 1 1
c 1 1

> dput(x)
list(c(1, 2, 3, 4, 5), c(1, 1, 1, 1, 1, 1))




Colin

--------------------
                     \
Colin Farrow          \
                       \---------------------------------------
                        \                                       \
Department of Geology,   \ E-mail: colin@geology.gla.ac.uk       \
University of Glasgow,    \                                       \
Glasgow, G12 8QQ. Scotland \ Tel: +44 (0)141 339 8855 x5466        \
                            \ Fax: +44 (0)141 330 4817              \
`````````````````````````````````````````````````````````````````````````
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: r-testers-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-