我正试图在Alteryx Rtool上输出我的wilcox测试,但我没有成功。这似乎是一个失败:;错误:R(12(:(函数(…,row.names=NULL,check.rows=FALSE,check.names=TRUE,:">
它在"OK"上运行;R〃;,但在Alteryx Rtool上显示此消息。我一行一行地跑,它在最后一行。输出。
以下是代码:
data <- read.Alteryx("#1")
#Verificar se o campo P-value está preenchido ou não
#Se for diferente de vazio está preenchido
if (data$p.value != '') {
Week1 <- read.Alteryx("#2")
"&"
Week2 <- read.Alteryx("#3")
}
Week1 <- as.data.table(Week1)
Week2 <- as.data.table(Week2)
# TESTE DE MANN WHITNEY (Variance Test for Non-Normal)
Week1_data <- Week1$Wk1_feature_value
Week2_data <- Week2$Wk2_feature_value
#define vectors
week1 <- c(Week1_data)
week2 <- c(Week2_data)
merge(cbind(week1, X=1:length(week1)),
cbind(week2, X=1:length(week2)), all.y =T)[-1]
# TESTE DE MANN WHITNEY (Variance Test for Non-Normal)
variance_wilcox<- wilcox.test(week1,week2, alternative='two.sided', conf.level=.95)
write.Alteryx(variance_wilcox, 1)``` **This last Line is the problem. The output.**
转换为tibble/data.frame结构后尝试,即
variance_wilcox <- broom::tidy(variance_wilcox)
解决方案下方:
variance_wilcox <- wilcox.test(week1,week2, alternative='two.sided', conf.level=.95)
variance_test <- tibble(variance_wilcox)
variance_test[] <- lapply(variance_test, as.character)
write.Alteryx(variance_test, 1)
感谢@akrun