Sub: Substract functional objects

View source: R/operations.R

SubR Documentation

Substract functional objects

Description

This subtraction is also able to add functions and BayesSpace objects. The sum of two functions is a function that results in the difference of the two results. The difference of two BayesSpace objects (in BData), is given by the BayesSpace operations, which is given by the quotient of the densities with respect to the reference measure.

Usage

Sub(x, y)

## S3 method for class ''function''
Sub(x, y)

## S3 method for class 'list'
Sub(x, y)

## S3 method for class 'numeric'
Sub(x, y)

## S3 method for class ''function''
Sub.function(x, y)

## S3 method for class ''function''
Sub.list(x, y)

## S3 method for class 'list'
Sub.function(x, y)

## S3 method for class 'numeric'
Sub.function(x, y)

## S3 method for class ''function''
Sub.numeric(x, y)

## S3 method for class 'numeric'
Sub.numeric(x, y)

## S3 method for class 'numeric'
Sub.list(x, y)

## S3 method for class 'list'
Sub.numeric(x, y)

## S3 method for class 'list'
Sub.list(x, y)

## S3 method for class 'BDataHistograms'
Sub(x, y)

## S3 method for class 'BDataHistograms'
Sub.BDataHistograms(x, y)

## S3 method for class 'BDataDensities'
Sub(x, y)

## S3 method for class 'BDataSplines'
Sub(x, y)

## S3 method for class 'BDataLogDensities'
Sub(x, y)

## S3 method for class 'BDataPDFs'
Sub(x, y)

## S3 method for class 'BDataLogPDFs'
Sub(x, y)

Arguments

x

a functional object

y

a functional object

Value

A BData object of the same subclass as the first argument (the Bayes-space sum / difference / scalar multiple / quotient).

Methods (by class)

  • Sub(`function`): method for functions

  • Sub(list): method for lists, iterating over the list

  • Sub(numeric): method for numerics, treating them as constant functions

  • Sub(BDataHistograms): method for BDataHistograms (operating in BayesSpaces)

  • Sub(BDataDensities): BayesSpace Difference for BDataDensities

  • Sub(BDataSplines): BayesSpace Difference for BDataSplines

  • Sub(BDataLogDensities): BayesSpace Difference for BDataLogDensities

  • Sub(BDataPDFs): BayesSpace Difference for BDataPDFs

  • Sub(BDataLogPDFs): BayesSpaceAddition for BDataLogPDFs

Functions

  • Sub.function(`function`): method for two functions, returning a function giving the difference of the two as a result

  • Sub.list(`function`): method for a function and list, iterating over the list

  • Sub.function(list): method for a function and list, iterating over the list

  • Sub.function(numeric): method substracting a constant value from a function

  • Sub.numeric(`function`): method substracting a function from a constant

  • Sub.numeric(numeric): method substracting two values

  • Sub.list(numeric): method for substracting a value from each element of a list, returning a list.

  • Sub.numeric(list): method each element of a list from a constant

  • Sub.list(list): method for vectorized application of sub on the elements of lists

  • Sub.BDataHistograms(BDataHistograms): method for two BDataHistograms

See Also

Other Add: Add(), Div(), Mul()

Examples

Sub(sin,cos)
Sub(list(sin,cos),sin)
Sub(cos,list(sin,cos))
Sub(list(sin,cos),list(sin,cos))
Sub(list(sin,cos),10)


DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.