Y1 <- 1:10 Y2 <- rep(7,10) wilcox.test(Y1,Y2) # Rank Sum Y <- Y1 - 7 wilcox.test(Y) Y1 <- 1:10 Y2 <- 7 + (1:10)/100 # a slightly modified example in order to avoid ties ## rank-sum test wilcox.test(Y1,Y2) wilcox.test(Y1,Y2, exact = FALSE) # normal approx. ## sign-rank test with second sample assumed = 7.05 wilcox.test(Y1-7.05) wilcox.test(Y1-7.05, exact = FALSE) # normal approx.