exp: Exponentiate or logharitmize the value.

Description Usage Arguments Details Examples

View source: R/lex.R

Description

exp and log returns exponentiated or logharitmized values.

Usage

1
2
3
exp(x)

log(x)

Arguments

x

Numeric.

Details

exp and log functions call the corresponding ones from base package, but also they set new class to values so that they can be checked later for they current state. This makes easier to track if the used values are in their normal or transformated form.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
mini_iris <- iris[c(1, 51, 101), ]
mini_iris
mini_iris$Sepal.Length <- exp(mini_iris$Sepal.Length)
mini_iris$Petal.Width <- log(mini_iris$Petal.Width)
mini_iris
class(mini_iris$Sepal.Length)
class(mini_iris$Petal.Width)
mini_iris$Sepal.Length <- log(mini_iris$Sepal.Length)
mini_iris$Petal.Width <- exp(mini_iris$Petal.Width)
mini_iris
class(mini_iris$Sepal.Length)
class(mini_iris$Petal.Width)

krzyslom/lex documentation built on May 20, 2019, 10:21 p.m.