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.
Package details |
|
---|---|
Author | Dr. Thomas Weise <tweise@hfuu.edu.cn> |
Maintainer | Dr. Thomas Weise <tweise@hfuu.edu.cn> |
License | LGPL-3 |
Version | 0.8.10 |
URL | http://github.com/thomasWeise/functionComposeR/ |
Package repository | View on GitHub |
Installation |
Install the latest version of this package by entering the following in R:
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.