[Rd] Curry: proposed new functional programming, er, function.

From: Byron Ellis <byron.ellis_at_gmail.com>
Date: Thu, 1 Nov 2007 12:00:27 -0700


Hi all (especially R-core) I suppose,

With the introduction of the new functional programming functions into base I thought I'd ask for a Curry() function. I use a simple one that looks this:

Curry = function(FUN,...) { .orig = list(...);function(...) do.call(FUN,c(.orig,list(...))) }

This comes in really handy when using say, heatmap():

heatmap(mydata,hclustfun=Curry(hclust,method="average"))

or other functions where there are ... arguments, but it's not clear where they should end up.

-- 
Byron Ellis (byron.ellis_at_gmail.com)
"Oook" -- The Librarian

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Thu 01 Nov 2007 - 19:20:30 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 Fri 02 Nov 2007 - 05:30:14 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.