Transformation.mapIntervals: Create a Bijective Mapping between two Intervals

Description Usage Arguments Value See Also Examples

View source: R/intervals.R

Description

Create a bijective mapping between the two real intervals [domainMin, domainMax] and [imageMin, imageMax]. The returned mapping will map domainMin to imageMin and domainMax to imageMax and vice versa.

Notice that domainMin>domainMax as well as imageMi >imageMax are both permissible, in which case smaller input values may map to larger output values.

Furthermore, although we specify domain and image boundaries, the returned mapping will not have any boundaries. It is entirely allowed to map values smaller than domainMin or larger than domainMax. These may then land outside of [imageMin, imageMax], though.

Usage

1
2
Transformation.mapIntervals(domainMin, domainMax, imageMin = 0,
  imageMax = 1)

Arguments

domainMin

the minimum of the original interval

domainMax

the maximum of the original interval

imageMin

the minimum of the goal interval

imageMax

the maximum of the goal interval

Value

a bijection between [d, domainMax] and [0,1]

See Also

Transformation.normalizeInterval

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
trafo <- Transformation.mapIntervals(-1, 1, 0, 2)
trafo
# An object of class "Transformation"
# Slot "forward":
# function (x)
# x + 1
# <environment: 0x35519c0>
#
# Slot "backward":
# function (x)
# x - 1
# <environment: 0x35519c0>
trafo <- Transformation.mapIntervals(0.2, 12, -0.1, 2)
trafo
# An object of class "Transformation"
# Slot "forward":
# function (x)
# (2.1 * ((x - 0.2)/11.8)) - 0.1
# <environment: 0x3c877f0>
#
# Slot "backward":
# function (x)
# 0.2 + (11.8 * ((x + 0.1)/2.1))
# <environment: 0x3c877f0>

thomasWeise/dataTransformeR documentation built on May 14, 2019, 8:03 a.m.