Inserting line breaks into text output in shiny using cat

前端 未结 2 1568
眼角桃花
眼角桃花 2021-01-27 16:45

I am trying to insert some line breaks using cat and \\n into some text output using shiny.

Here are the relevant parts of my

2条回答
  •  灰色年华
    2021-01-27 17:08

    Here is a solution using renderUI and htmlOutput

    library(shiny)
    Group_A <- 1:13
    Group_B <- 8:19
    
    runApp(
      list(
        ui = fluidPage(
          htmlOutput("text3")
          ),
        server = function(input, output){
          output$text3 <- renderUI({
    
            obj <-  t.test(Group_A, Group_B)
            HTML(
              paste0("t = ", round(obj[[3]],3), '
    ', "df = ", round(obj[[2]],3), '
    ', "p-value = ", round(obj[[3]],5)) ) }) }))

提交回复
热议问题