[Rd] aperm doesn't copy attributes

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Thu, 20 Sep 2007 08:55:08 -0400


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}}

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu 20 Sep 2007 - 12:59:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 20 Sep 2007 - 20:42:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.