standard {BAT} | R Documentation |
Standardize (or normalize) variables in different ways.
standard(trait, method = "standard", convert = NULL)
trait |
A species x traits matrix or data.frame. |
method |
One of "standard" (standardize to mean = 0 and sd = 1, i.e., use z-score), "range" (rescale with range 0-1), or "rank" (rescale with range 0-1 after ranking). |
convert |
A vector of column numbers to be standardized. If NULL all will be standardized. |
Standardizing values allows to directly compare variables of interest with inherently different ranges, avoiding artificial distortions of distances between observations.
A matrix with variables standardized.
trait = data.frame(body = c(20,40,60,30,10), beak = c(NA,4,6,3,1)) standard(trait) standard(trait, method = "range") standard(trait, method = "rank")