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

From: Dietrich Trenkler <Dietrich.Trenkler_at_uni-osnabrueck.de>
Date: Wed, 11 Jun 2008 12:35:41 +0200

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.
Received on Wed 11 Jun 2008 - 13:10:29 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 Wed 11 Jun 2008 - 15:00:41 GMT.

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

list of date sections of archive