R Shiny T-test returning error with reactive input

126 Views Asked by At

T.test function works in my Shiny app until I make one of the variables reactive then it returns Error:variable lengths differ (found for 'Group')

output$t_test <- reactive({
                           t_test_result <- t.test(Age ~ Group, data, var.equal = TRUE)
                           print(t_test_result$p.value) })

works

output$t_test <- reactive({
                           t_test_result <- t.test(input$Age ~ Group, data, var.equal = TRUE)
                           print(t_test_result$p.value) })

Returns Error:variable lengths differ (found for 'Group')

I haven't been able to find any posts with this exact issue.

0

There are 0 best solutions below