`I wonder how I would like to change this code so that the corresponding values โโof both vectors cannot be equal. As an example: if x = (1, 2, 2, 4, 8, 1, 7, 9, 5, 10) and y = (3, 2, 7, 8, 4, 10, 4, 8, 2, 1), then for both vectors they are equal to 2. Does it mean that R can repeat the sampling in this second spot in the vector x until it is the same value in the vector y?
x <- c(1:10) y <- c(1:10) sample_x <- sample(x, length(10), replace = TRUE) z <- sample_x > y`
source share