From mike at stat.ubc.ca  Mon Oct 12 02:05:11 2009
From: mike at stat.ubc.ca (mike at stat.ubc.ca)
Date: Mon, 12 Oct 2009 02:05:11 +0200 (CEST)
Subject: [Rd] unexpected behaviour of isSymmetric() (PR#14000)
Message-ID: <20091012000511.C97B2282EF50@mail.pubhealth.ku.dk>

Full_Name: Mike Danilov
Version: 2.9.0
OS: Fedora Core 9
Submission from: (NULL) (142.103.121.198)


When checking for the symmetry of a matrix, function isSymmetric.matrix() gets
confused by the discrepancy of colnames/rownames if its argument. See the code
snippet below. Perhaps it's a problem of the matrix product which copies
colnames of the first argument but not the rownames of the second to its value.
Not sure which one should be fixed but the way it is now it seems illogical that
X'X is deemed to be non-symmetric.

x <- c(1,2,3)
names(x) <- c("v1","v2","v3")
isSymmetric(x%*%t(x)) ## returns FALSE instead of TRUE



[Rd] unexpected behaviour of isSymmetric() (PR#14000)
mike at stat.ubc.ca