From michael.m.spiegel at gmail.com  Thu May 14 15:45:09 2009
From: michael.m.spiegel at gmail.com (michael.m.spiegel at gmail.com)
Date: Thu, 14 May 2009 15:45:09 +0200 (CEST)
Subject: [Rd] diag() has a bug (PR#13702)
Message-ID: <20090514134509.58502282BE82@mail.pubhealth.ku.dk>

Full_Name: Michael Spiegel
Version: 2.9.0
OS: linux
Submission from: (NULL) (204.111.252.142)


The diag() function appears to reject the first argument when it is a matrix,
and nrow and ncol arguments are also provided.

> foo <- matrix(c(1:4),2,2)
> foo
     [,1] [,2]
[1,]    1    3
[2,]    2    4
> diag(foo)
[1] 1 4
> diag(foo, 2, 2)
Error in diag(foo, 2, 2) : first argument is array, but not matrix.
> is.matrix(foo)
[1] TRUE



[Rd] diag() has a bug (PR#13702)
michael.m.spiegel at gmail.com