vfunc-package: Manipulate Virtual Functions

vfunc-packageR Documentation

Manipulate Virtual Functions

Description

If f <- function(x){x^2} and g <- function(x){x+1} it is a constant source of annoyance to me that “f+g” is not defined. Package vfunc allows you to do this.

Details

The package defines a single S4 class, vf. This has a single slot, .Data, of type function which means that vf objects inherit much of the behaviour of functions, but for which new methods (such as the Arith group of S4 generics) may be defined.

Documentation Index

Index: This package was not yet installed at build time.

Author(s)

Robin K. S. Hankin [aut, cre] (ORCID: <https://orcid.org/0000-0001-5982-0415>)

Maintainer: Robin K. S. Hankin <hankin.robin@gmail.com>

Examples

f <- as.vf(function(x){x^2})

f + Sin

as.function(f*Sin + Exp)(1:4)

vfunc documentation built on Aug. 8, 2025, 6:20 p.m.