pgu.transformator: pgu.transformator

Description Format Details Active bindings Methods Author(s)

Description

Transforms the data of pguIMP.

Format

R6::R6Class object.

Details

Performs a data transformation in order to achieve a normally distributed version of the dataframe. This object is used by the shiny based gui and is not for use in individual R-scripts!

Active bindings

trafoAlphabet

Returns the instance variable trafoAlphabte.

trafoParameter

Returns the instance variable trafoParameter.

Methods

Public methods


Method new()

Creates and returns a new pgu.transformator object.

Usage
pgu.transformator$new(data_df = "tbl_df")
Arguments
data_df

The data to be analyzed. (tibble::tibble)

Returns

A new pgu.transformator object. (pguIMP::pgu.transformator)


Method finalize()

Clears the heap and indicates that instance of pgu.transformator is removed from heap.

Usage
pgu.transformator$finalize()

Method print()

Prints instance variables of a pgu.transformator object.

Usage
pgu.transformator$print()
Returns

string


Method resetTrafoParameter()

Resets instance variable trafoParameter

Usage
pgu.transformator$resetTrafoParameter(data = "tbl_df")
Arguments
data

Dataframe to be analyzed. (tibble::tibble)


Method trafoType()

Returns entry of trafoType for user defined attribute.

Usage
pgu.transformator$trafoType(feature = "character")
Arguments
feature

Attribute's name. (character)

Returns

Value of entry. (character)


Method setTrafoType()

Sets entry of trafoType for user defined attribute.

Usage
pgu.transformator$setTrafoType(feature = "character", type = "character")
Arguments
feature

Attribute's name. (character)

type

Trafo type parameter. Valid choices are: "none", "exponential", "log2", "logNorm", "log10", "arcsine", "tukeyLOP", "boxCox". (character)


Method addConstant()

Returns entry of addConst for user defined attribute.

Usage
pgu.transformator$addConstant(feature = "character")
Arguments
feature

Attribute's name. (character)

Returns

Value of entry. (numeric)


Method mirrorLogic()

Returns entry of mirrorLogic for user defined attribute.

Usage
pgu.transformator$mirrorLogic(feature = "character")
Arguments
feature

Attribute's name. (character)

Returns

Value of entry. (logical)


Method setMirrorLogic()

Sets entry of mirrorLogic for user defined attribute.

Usage
pgu.transformator$setMirrorLogic(feature = "character", logic = "logical")
Arguments
feature

Attribute's name. (character)

logic

Specifies whether the data should be mirrored at the coordinate origin. (logical)


Method lambdaLOP()

Returns entry of lambda_lop for user defined attribute. Lambda is a specific optimization parameter that is derived from the Tukey-LOP transfromation procedure.

Usage
pgu.transformator$lambdaLOP(feature = "character")
Arguments
feature

Attribute's name. (character)

Returns

Value of entry. (numeric)


Method setLambdaLOP()

Sets entry of lambda_lop for user defined attribute.

Usage
pgu.transformator$setLambdaLOP(feature = "character", lambda = "numeric")
Arguments
feature

Attribute's name. (character)

lambda

Sets the feature specific exponential value. (numeric)


Method lambdaBC()

Returns entry of lambda_bc for user defined attribute. Lambda is a specific optimization parameter that is derived from the Box-Cox transfromation procedure.

Usage
pgu.transformator$lambdaBC(feature = "character")
Arguments
feature

Attribute's name. (character)

Returns

Value of entry. (numeric)


Method lambdaAS()

Returns entry of lambda_as for user defined attribute. Lambda is a specific optimization parameter that is derived from the arcsine transfromation procedure.

Usage
pgu.transformator$lambdaAS(feature = "character")
Arguments
feature

Attribute's name. (character)

Returns

Value of entry. (numeric)


Method featureIdx()

Returns the index of a pgu.normDist object wihtin the instance variable trafoParameter.

Usage
pgu.transformator$featureIdx(feature = "character")
Arguments
feature

Attribute's name. (character)

Returns

Index of attribute entry in dataframe (numeric)


Method addConstGenerator()

Calculates and returns the addConst. A constant that prevents the occurrence of negative values as well as zero, if added to an attribute.

Usage
pgu.transformator$addConstGenerator(value = "numeric")
Arguments
value

The smallest of the attribute's values. (numeric)

Returns

The addConst for the attribute (numeric)


Method mirrorNumeric()

Mirrors the assigned values at the coordinate origin.

Usage
pgu.transformator$mirrorNumeric(value = "numeric")
Arguments
value

Value or vector of values. (numeric)

Returns

Value or vector of values. (numeric)


Method mirrorData()

Calls the class' mirrorNumeric function on all numeric attributes of a data frame.

Usage
pgu.transformator$mirrorData(data = "tbl_df")
Arguments
data

A data frame. (tibble:tibble)

Returns

A data frame (tibble::tibble)


Method calculateAddConst()

Calculates the addConst value for each attribute of the assigned data frame, by calling the class' addConstGenerator function. The results are stored in addConst attribute of the trafoParameter instance variable.

Usage
pgu.transformator$calculateAddConst(data = "tbl_df")
Arguments
data

A data frame. (tibble:tibble)


Method translateNumeric()

Translates the assigned values by a constant.

Usage
pgu.transformator$translateNumeric(value = "numeric", const = "numeric")
Arguments
value

A numeric or a vector of numerics to be translated. (numeric)

const

A constant value. (numeric)

Returns

A numeric or a vector of numerics. (numeric)


Method translateData()

Translates each attribute of the assigned data frame, by calling the class' translateNumeric function. The respective addConst values of the individual attributes of the data frame serve as const variables.

Usage
pgu.transformator$translateData(data = "tbl_df")
Arguments
data

A data frame. (tibble:tibble)

Returns

A data frame. (tibble:tibble)


Method backTranslateNumeric()

Back-translates the assigned values by a constant.

Usage
pgu.transformator$backTranslateNumeric(value = "numeric", const = "numeric")
Arguments
value

A numeric or a vector of numerics to be back-translated. (numeric)

const

A constant value. (numeric)

Returns

A numeric or a vector of numerics. (numeric)


Method backTranslateData()

Back-translates each attribute of the assigned data frame, by calling the class' backTranslateNumeric function. The respective addConst values of the individual attributes of the data frame serve as const variables.

Usage
pgu.transformator$backTranslateData(data = "tbl_df")
Arguments
data

A data frame. (tibble:tibble)

Returns

A data frame. (tibble:tibble)


Method lambdaEstimator()

Estimates the lambda factor for the given values, that are assigned to a user defined attribute..

Usage
pgu.transformator$lambdaEstimator(value = "numeric", feature = "character")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

feature

The attribute which the given values are assigned to. (character)

Returns

The specific lambda factor. (numeric)


Method estimateLambda_temp()

Estimates the lambda factor for each attribute of the assigned data frame, by calling the class' lambdaEstimator function. The respective lambda values of the individual attributes of the data frame are stored in the lambda attribute of the instance variable trafoParameter.

Usage
pgu.transformator$estimateLambda_temp(data = "tbl_df")
Arguments
data

A data frame. (tibble:tibble)


Method estimateLambda()

Estimates the arcsine transformation lambda factor for each attribute of the assigned data frame. The respective lambda values of the individual attributes of the data frame are stored in the lambda attribute of the instance variable trafoParameter.

Usage
pgu.transformator$estimateLambda(data = "tbl_df")
Arguments
data

A data frame. (tibble:tibble)


Method normalizeArcSine()

Estimates the lambda factor for an arcsine transformation for the given values,

Usage
pgu.transformator$normalizeArcSine(value = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

Returns

The specific lambda factor. (numeric)


Method optimizeTukeyLadderOfPowers()

Estimates the lambda factor for a tukeyLOP transformation for the given values,

Usage
pgu.transformator$optimizeTukeyLadderOfPowers(value = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

Returns

The specific lambda factor. (numeric)


Method optimizeBoxCox()

Estimates the lambda factor for a boxcox transformation for the given values,

Usage
pgu.transformator$optimizeBoxCox(value = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

Returns

The specific lambda factor. (numeric)


Method transformNumeric()

Transforms the given numeric values, that are assigned to a user defined attribute.

Usage
pgu.transformator$transformNumeric(value = "numeric", feature = "character")
Arguments
value

A numeric or a vector of numerics to be tranformed. (numeric)

feature

The attribute which the given values are assigned to. (character)

Returns

A transfromed version of the given numeric or vector of numerics. (numeric)


Method transformData()

Transforms each attribute of the assigned data frame, by calling the class' tranformNumeric function. The respective lambda values of the individual attributes of the data frame are read from the lambda attribute of the instance variable trafoParameter.

Usage
pgu.transformator$transformData(data = "tbl_df")
Arguments
data

A data frame. (tibble:tibble)


Method transformLogModulus()

Performes a log transformation for the given values, based on a user defined base value.

Usage
pgu.transformator$transformLogModulus(value = "numeric", base = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

base

Logarithmic base. (numeric)

Returns

The transformed values. (numeric)


Method transformSquareRoot()

Performes a square root transformation for the given values.

Usage
pgu.transformator$transformSquareRoot(value = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

Returns

The transformed values. (numeric)


Method transformCubeRoot()

Performes a cube root transformation for the given values.

Usage
pgu.transformator$transformCubeRoot(value = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

Returns

The transformed values. (numeric)


Method transformArcsine()

Performes an arcsine transformation for the given values.

Usage
pgu.transformator$transformArcsine(value = "numeric", lambda = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

lambda

Normalization factor. (numeric)

Returns

The transformed values. (numeric)


Method transformInverse()

Performes an inverse transformation for the given values.

Usage
pgu.transformator$transformInverse(value = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

Returns

The transformed values. (numeric)


Method transformTukeyLadderOfPowers()

Performes a tukeyLOP transformation for the given values.

Usage
pgu.transformator$transformTukeyLadderOfPowers(
  value = "numeric",
  lambda = "numeric"
)
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

lambda

Lambda factor. (numeric)

Returns

The transformed values. (numeric)


Method transformBoxCox()

Performes a boxcox transformation for the given values.

Usage
pgu.transformator$transformBoxCox(value = "numeric", lambda = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

lambda

Lambda factor. (numeric)

Returns

The transformed values. (numeric)


Method inverseTransformNumeric()

Inverse transforms the given numeric values, that are assigned to a user defined attribute.

Usage
pgu.transformator$inverseTransformNumeric(
  value = "numeric",
  feature = "character"
)
Arguments
value

A numeric or a vector of numerics to be tranformed. (numeric)

feature

The attribute which the given values are assigned to. (character)

Returns

An inverse transfromed version of the given numeric or vector of numerics. (numeric)


Method inverseTransformData()

Inverse transforms each attribute of the assigned data frame, by calling the class' tranformNumeric function. The respective lambda values of the individual attributes of the data frame are read from the lambda attribute of the instance variable trafoParameter.

Usage
pgu.transformator$inverseTransformData(data = "tbl_df")
Arguments
data

A data frame. (tibble:tibble)


Method inverseTransformLogModulus()

Performes an inverse log transformation for the given values, based on a user defined base value.

Usage
pgu.transformator$inverseTransformLogModulus(
  value = "numeric",
  base = "numeric"
)
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

base

Logarithmic base. (numeric)

Returns

The transformed values. (numeric)


Method inverseTransformSquareRoot()

Performes an inverse square root transformation for the given values.

Usage
pgu.transformator$inverseTransformSquareRoot(value = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

Returns

The transformed values. (numeric)


Method inverseTransformCubeRoot()

Performes an inverse cube root transformation for the given values.

Usage
pgu.transformator$inverseTransformCubeRoot(value = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

Returns

The transformed values. (numeric)


Method inverseTransformArcsine()

Performes an inverse arcsine transformation for the given values.

Usage
pgu.transformator$inverseTransformArcsine(
  value = "numeric",
  lambda = "numeric"
)
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

lambda

Normalization factor. (numeric)

Returns

The transformed values. (numeric)


Method inverseTransformInverse()

Performes an inverse inverse-transformation for the given values.

Usage
pgu.transformator$inverseTransformInverse(value = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

Returns

The transformed values. (numeric)


Method inverseTransformTukeyLadderOfPowers()

Performes an inverse tukeyLOP transformation for the given values.

Usage
pgu.transformator$inverseTransformTukeyLadderOfPowers(
  value = "numeric",
  lambda = "numeric"
)
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

lambda

Lambda factor. (numeric)

Returns

The transformed values. (numeric)


Method inverseTransformBoxCox()

Performes an inverse boxcox transformation for the given values.

Usage
pgu.transformator$inverseTransformBoxCox(value = "numeric", lambda = "numeric")
Arguments
value

A numeric or a vector of numerics to be analyzed. (numeric)

lambda

Lambda factor. (numeric)

Returns

The transformed values. (numeric)


Method fit()

Estimate all transformation parameters(lambda, addConst,...) for each attribute of a given data frame. The function calls the class' functions calculateAddConst and estimateLambda. The results are stored in the respective attributes of the instance variable trafoParameter.

Usage
pgu.transformator$fit(data = "tbl_df")
Arguments
data

A data frame. (tibble:tibble)


Method mutateData()

Mutates the values of each attribute of a given data frame. Here, mutation is defined as the cesecutive sequence of the class' functions mirrorData, tranlsateData and transfromData.

Usage
pgu.transformator$mutateData(data = "tbl_df")
Arguments
data

A data frame. (tibble:tibble)

Returns

A mutated data frame. (tibble::tibble)


Method reverseMutateData()

Re-mutates the values of each attribute of a given data frame. Here, re-mutation is defined as the cesecutive sequence of the class' functions inverseTransformData, backTranslateData, mirrorData

Usage
pgu.transformator$reverseMutateData(data = "tbl_df")
Arguments
data

A data frame. (tibble:tibble)

Returns

A mutated data frame. (tibble::tibble)


Method clone()

The objects of this class are cloneable with this method.

Usage
pgu.transformator$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Sebastian Malkusch, malkusch@med.uni-frankfurt.de


pguIMP documentation built on Sept. 30, 2021, 5:08 p.m.