如何避免wilcox.test中的警告消息

sta*_*ata 2 r

x <- c(9, 5, 9 ,10, 13, 8, 8, 13, 18, 30)
y <- c(10, 6, 9, 8, 11, 4, 1, 3, 3, 10)
wilcox.test(y,x, paired=TRUE,correct = FALSE)
Run Code Online (Sandbox Code Playgroud)

提交这些代码时出现警告消息.如何避免wilcox.test.Thanks中的警告消息!

Ben*_*ker 5

使用

suppressWarnings(wilcox.test(...))
Run Code Online (Sandbox Code Playgroud)

或更好)

wilcox.test(...,exact=FALSE)
Run Code Online (Sandbox Code Playgroud)

要么

library(coin)
wilcoxsign_test(y~x,zero="Pratt")
Run Code Online (Sandbox Code Playgroud)