1
我使用dunn.test()
從包dunn.test
,我不希望它打印任何東西到標準輸出(控制檯),因爲我做了很多次,我想看看如果我在此之前有任何警告。控制鄧恩測試的輸出
所以我取消了克魯斯卡Wallis檢驗的打印,表像這 -
dunn.test(x = data, g = grouping, kw = FALSE, table = FALSE)
的打印,但每次測試後仍然打印換行,有沒有什麼辦法,以防止它打印新隊?或者一種方法來捕獲新行被打印?的dunn.test
重複的例子 -
library(dunn.test)
df <- data.frame(d = c(rnorm(100), rnorm(100, 5)),
group1 = rep(c('a','b','c','d'),50),
group2 = rep(c('a','b','c','d'),each =50))
test1 <- dunn.test(x = df$d, df$group1)
test2 <- dunn.test(x = df$d, df$group2)
test3 <- dunn.test(x = df$d, df$group1, kw = FALSE)
test4 <- dunn.test(x = df$d, df$group1, kw = FALSE, table = FALSE) # still prints a newline
謝謝!那很棒! –