Inserting line breaks into text output in shiny using cat

前端 未结 2 1540
眼角桃花
眼角桃花 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), '<br/>', 
                  "df = ", round(obj[[2]],3), '<br/>',
                  "p-value = ", round(obj[[3]],5))
            )
          })
        }))
    
    0 讨论(0)
  • 2021-01-27 17:22

    Use a paragraph tag with nothing inside like tags$p("a"), see here

    0 讨论(0)
提交回复
热议问题