Alteryx Rtool 给出输出失败

Alteryx Rtool giving output failure

我正在尝试在 Alteryx Rtool 上输出我的 wilcox 测试,但我没有成功。看起来失败了:“错误:R(12):错误(函数(...,row.names = NULL,check.rows = FALSE,check.names = TRUE,:“

运行在“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