From andy_liaw at merck.com  Thu Sep 20 14:55:08 2007
From: andy_liaw at merck.com (Liaw, Andy)
Date: Thu, 20 Sep 2007 08:55:08 -0400
Subject: [Rd] aperm doesn't copy attributes
Message-ID: <39B6DDB9048D0F4DAD42CB26AAFF0AFA04B2986B@usctmx1106.merck.com>

In the "Value" section of ?aperm, I see:

`... In each case other attributes are copied from a.'

However:

R> f <- factor(sample(letters[1:2], 10, replace=TRUE))
R> dim(f) <- c(5, 2)
R> t(f)
     [,1] [,2] [,3] [,4] [,5]
[1,] a    a    b    b    b   
[2,] a    a    b    a    a   
Levels: a b
R> aperm(f, c(2, 1))
     [,1] [,2] [,3] [,4] [,5]
[1,]    1    1    2    2    2
[2,]    1    1    2    1    1

Examining attributes() of the above shows that the result from aperm
only retained the dim attribute.

Does this qualify as a bug?

R> sessionInfo()
R version 2.6.0 beta (2007-09-18 r42895) 
i386-pc-mingw32 

locale:
LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
States.1252;LC_MONETARY=English_United
States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base


--
Andy Liaw, PhD
Biometrics Research    PO Box 2000 RY33-300
Merck Research Labs        Rahway, NJ 07065
andy_liaw(a)merck.com          732-594-0820



------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments,...{{dropped}}



[Rd] aperm doesn't copy attributes
Liaw, Andy