用来取出数值的符号,数值可以是单个数字或者是数值向量 > sign(3) [1] 1 > sign(-2) [1] -1 > sign(c(1,2,-3,-5,-3)) [1] 1 1 -1 -1 -1