[R] matrix transpose

Wacek Kusnierczyk Waclaw.Marcin.Kusnierczyk at idi.ntnu.no
Sun Feb 15 21:32:20 CET 2009

Rolf Turner wrote:
> On 16/02/2009, at 8:36 AM, Roger wrote:
>> This is supposed to be an easy operation, but R 2.8.1 on Mac OS X
>> gives me a
>> lot trouble. the t() function simply does not work properly.  What I
>> mean is
>> it works sometimes but does not work at the most of the time, even
>> with the
>> same matrix.
>> this is an example taken from R help
>>> a <- matrix(1:30, 5,6)
>>> t(a)
>> Error in t(a) : unused argument(s) (1:30)
>> It just gives this error.  If I restart my Mac (Yeah, have to restart
>> the
>> OS), then there are chances t() works, but sometimes it still does
>> not work.
>> Can anyone give me another way to compute the transpose in R?
> No.  That's the only way. :-)

nonsense.  the other way is:


if this works while t(a) fails, the problem is solved (= do *not*
redefine t).  if this doesn't work, complain again ;)


More information about the R-help mailing list