a <- c(1, 2,3,4,5,6)
b <- c(3,1,2,8,3,8)
c <- rbind(a,b)
Expected Output
D <- 3 2 1.5 2 1.6 1.3
i.e Numbers of times values of "a" is more or less than values of "b"
a <- c(1, 2,3,4,5,6)
b <- c(3,1,2,8,3,8)
c <- rbind(a,b)
Expected Output
D <- 3 2 1.5 2 1.6 1.3
i.e Numbers of times values of "a" is more or less than values of "b"
Please make effort to clearly describe your issue.
Please use words to describe the mathematics to create D from a and b ?
Original question edit as needed.
Do you mean for any number a and b, find the largest number, then divide it by the smaller number ?
Yes, I want the same.
a <- c(1, 2,3,4,5,6)
b <- c(3,1,2,8,3,8)
round(ifelse(a>=b,a/b,b/a) ,digits=1)