Skip to content
Prev 40100 / 63424 Next

Curry: proposed new functional programming, er, function.

On Wed, May 4, 2011 at 10:40 AM, Ravi Varadhan <rvaradhan at jhmi.edu> wrote:
Here is another approach. If we preface any function with gsubfn's fn$
then it will turn formulas (subject to certain rules to determine
which to pay attention to) into functions.

1. Here it is applied to the cubature example
Loading required package: proto
$integral
[1] 0.4677446

$error
[1] 1.247382e-14

$functionEvaluations
[1] 15

$returnCode
[1] 0


2. and here is the heatmap example redone.  The example line is to
compute x so that the code is self contained:

library(gsubfn)
example(heatmap)

fn$heatmap(x, hclustfun = ~ hclust(x, method="average"))