运行以下命令时:
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
标签:stat,wilcox,报错,test,exist,colnames
From: https://www.cnblogs.com/chenwenyan/p/17140929.html