The tw_transf function is used to apply two-way transformation on a single variable.
Arguments
- x
a numeric vector the two-way transformation is supposed to be performed on.
- t
a vector of integers that indicates the time.
- i
a vector that indicates the unit.
Value
The tw_transf function returns two-way transformed data which are reordered by unit and time.
Examples
set.seed(100)
x <- rnorm(20)
t <- rep(1:5, each = 4)
i <- rep(letters[1:4], times=5)
df_transf <- tw_transf(x,t,i)