thomasWeise/functionComposeR: R Package for Composing and Canonicalizing Functions

This package provides four functions, namely \code{expression.simplify}, which attempts to resolve as many sub-expressions of an expression as possible, \code{function.canonicalize}, which tries to resolve the promises and variables inside a function, \code{function.substitute}, which substitutes a specified subset of the formal parameters of a function with specified values, yielding a function of smaller arity, and \code{function.compose} which combines/chains two functions together. The goal is to be able to produce readable and quick-to-evaluate functions, in particular to be able to compose functions iteratively without creating more and more complex entities that depend on different environments and are largely opaque. With this package, you can retain readble functions with as many variables substituted by constants and sub-expressions evaluated to constants as possible, which should also speed up the computation of the functions. Additionally, the functions try to replace identical sub-expressions by the same object. This can potentially make the function execution more cache friendly. Still, please be aware that this is a hacked-together early draft version of the package (as indicated by the version number). There may be many border cases where it produces nonsense. Please carefully test whether it does exactly what you want before using it.

Getting started

Package details

AuthorDr. Thomas Weise <[email protected]>
MaintainerDr. Thomas Weise <[email protected]>
Package repositoryView on GitHub
Installation Install the latest version of this package by entering the following in R:
thomasWeise/functionComposeR documentation built on July 20, 2018, 10:53 p.m.