I have 2 input values to execute t.test in my shiny application. But when i tried below code, the output is not displayed. Can anyone help me
output$renderprint <- renderPrint({
t.test(paste0(as.numeric(input$num),"~" ,input$cat,data = input_data))
})
input$num is character values and input$cat is character
Error I am getting . Not sure why? Can we not declare input$num and input$cat in t.test? Because when I code directly as t.test(as.numeric(var1) ~ var2, data = input_data), I get the results. But if declare as t.test(paste0(as.numeric(input$num),"~" ,input$cat,data = input_data)) , I will not get the output
Warning in mean.default(x) :
argument is not numeric or logical: returning NA
Warning in var(x) : NAs introduced by coercion
Warning: Error in if: missing value where TRUE/FALSE needed