-1

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(input$num ,"~" ,input$cat,data = input_data))    
}) 

input$num is numeric values and input$catis character.

Ronak Shah
  • 377,200
  • 20
  • 156
  • 213
user11740857
  • 502
  • 3
  • 10

1 Answers1

0

Here is a minimal example of a shiny app showing the results of a t test.

library(shiny)

ui <- fluidPage(
  
    textOutput("mytextoutput")
    
)

server <- function(input, output, session) {
  
    output$mytextoutput <- renderPrint({

        t.test(sleep$extra ~ sleep$group, data = sleep)

    })
    
}

shinyApp(ui, server)

If you include a minimal reproducible example, including some example data and an app we can run, we can provide a more detailed answer.

Ash
  • 1,463
  • 1
  • 4
  • 7