# NOT RUN {
##
## 1. default
##
sx <- sign((-2):2)
# check
# }
# NOT RUN {
all.equal(sx, base::sign((-2):2))
# }
# NOT RUN {
##
## 2. with zero = 1
##
s1 <- sign((-2):2, 1)
# check
# }
# NOT RUN {
all.equal(s1, rep(c(-1, 1), c(2,3)))
# }
Run the code above in your browser using DataLab