powered by
This function transforms a dataset from absolute to relative frequencies (by row or column).
TSS(X, rows = TRUE)
A relative frequency matrix or data.frame with the same dimension than X.
Numeric matrix or data.frame of any size containing absolute frequencies.
If TRUE, the operation is done by row; otherwise, it is done by column. (Defaults: TRUE).
dat <- matrix(rnorm(50),ncol=5,nrow=10) TSS(dat) #It can be checked that, after scaling, the sum of each row is equal to 1.
Run the code above in your browser using DataLab