Author Login
Post Reply
Hi, all
is there a built-in function to compare two numbers?
something like following function
cmp <- function(x, y){
value <- 0
if (x > y){
value <- 1
}else if (x == y){
value <- 0
}else {
value <- -1
}
return(value)
}
Thanks in advance,
Hyunchul
[[alternative HTML version deleted]]
______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.