[R] R idiom list? [was: Matrix transformation problem

Gabor Grothendieck ggrothendieck at gmail.com
Wed Jun 11 15:00:08 CEST 2008


Google for Rtips.

Also Rwiki

On Wed, Jun 11, 2008 at 6:35 AM, Dietrich Trenkler
<Dietrich.Trenkler at uni-osnabrueck.de> wrote:
> Dimitris Rizopoulos schrieb:
>>
>> sorry, my previous answer was not correct; you need:
>>
>> x <- matrix(c(1,0,0, 0,0,1, 0,1,0, 0,0,1, 0,1,0, 1,0,0),
>>   ncol = 3, byrow = TRUE)
>> which(t(x == 1), arr.ind = TRUE)[, "row", drop = FALSE]
>>
> Dear helpeRs,
>
> I would like to use this thread for a proposal which lingered in my head
> for quite a while.  Several years ago I was an APL aficionado and I very
> much liked the idea of an APL idiom list (see e.g
> http://www.pyr.fi/apl/texts/Idiot.htm).
>
> Looking at the solution of Dimitris Rizopoulos wouldn't it be nice not to
> have it disappear in the archives?  To be explicit I would like to
> propose an R idiom list.  If there does exist one please forgive my
> ignorance.
>
> Best regards
>
> Dietrich
>
>
> --
> Dietrich Trenkler c/o Universitaet Osnabrueck Rolandstr. 8; D-49069
> Osnabrueck, Germany    email: Dietrich.Trenkler at Uni-Osnabrueck.de
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list