R语言:wilcox_test 出现报错 Can't extract columns that don't exist. x Column doesn't exist.
运行以下命令时:
stat.test <- all %>%
wilcox_test(colnames(all)[1] ~ colnames(all)[2]) %>%
adjust_pvalue(method ="BH") %>%
add_significance("p.adj")
stat.test
出现报错:
Error in
vec_as_location2_result()
:
! Can't extract columns that don't exist.
x Columncolnames(all)[1]
doesn't exist.
解决方案:
stat.test <- all %>%
wilcox_test(as.formula(paste(colnames(all)[1], colnames(all)[2], sep = "~"))) %>%
adjust_pvalue(method ="BH") %>%
add_significance("p.adj")
stat.test
本文来自博客园,作者:橙子牛奶糖(陈文燕),转载请注明原文链接:https://www.cnblogs.com/chenwenyan/p/17140929.html