标签: r
这个功能有什么问题? 如果所有值都为0,我需要返回相同的向量作为输入,否则min-max标准化
normalize <- function(x) { if (all(x==0)) return x return((x-min(x))/(max(x)-min(x))) }