View source: R/data-auto-trans.R
auto_trans | R Documentation |
transformation
auto_trans(x, ...)
## S3 method for class 'data.frame'
auto_trans(x, add = TRUE, ...)
## Default S3 method:
auto_trans(x, treshhold = 1, ...)
x |
Vector |
... |
weitere Argumente |
add |
spalte hinzufügen oder ersätzen |
treshhold |
grundlienie |
Vector mit attr link, inverse und name
n<-100
x1 = rnorm(100)+5
x2 = rlnorm(n, meanlog = 0, sdlog = 1)+1
x3 = rpois(n, lambda = 1)+1
x4 = rweibull(n, shape = .8, scale = 1)+10
x5 = runif(n, min = 0, max = 100)+1
auto_trans(x2)
#'
x.neg <- rbeta(10000, 5, 2) # Negative Skew
x.pos <- rexp(1000, 1) # Positive Skew
par(mfrow=c(2,2))
hist(x.neg)
hist(x.pos)
hist(auto_trans(x.neg))
hist(auto_trans(x.pos))
n <- 100
scale_100 <- function(x) {
x <- x - min(x)
round(x / max(x) * 100)
}
DF <- data.frame(
group = gl(2, n / 2, labels = c("Control", "Treat")),
x1 = scale_100(rnorm(100) + 5),
x2 = scale_100(rlnorm(n, meanlog = 0, sdlog = 1) + 1),
x3 = scale_100(rpois(n, lambda = 1) + 1),
x4 = scale_100(rweibull(n, shape = .8, scale = 1) + 10),
x5 = scale_100(runif(n, min = 0, max = 100) + 1),
x6 = scale_100(sqrt(rnorm(100) + 5))
)
auto_trans(DF)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.