ralteryx

Alteryx Rtool giving output failure


I am trying to output my wilcox test on Alteryx Rtool, but I am not suceeding. It appears a failure: "Error: R (12): Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, : "

It runs OK on "R", but on Alteryx Rtool it appears this message. I run line per line and it is on the last line. The output.

Below is the code:

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.** 

Solution

  • Try after converting to a tibble/data.frame structure i.e.

    variance_wilcox <- broom::tidy(variance_wilcox)
    

    Below the solution:

    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)
    

    Thanks to @akrun