Description Main functions Helper functions purrr syntax
The funprog package implements in R some functions existing in other pure functional programming languages.
The package provides high-order functions, for example :
group_if
, inspired by Haskell's groupBy
sort_by
, inspired by Haskell's sortBy
Helper functions can be used in conjunction with the main functions :
%on%
combines two functions into one and serves to create a
predicate function to group_if
descending
is used to reverse the output of a sorting
function used with sort_by
purrr
syntaxIf the purrr package is installed, you
can use its special syntax to create very compact anonymous functions, for
example ~ abs(.x - .y) > 1
instead of function(x, y) abs(x - y)
> 1
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.