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
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))
)
})
}))
Use a paragraph tag with nothing inside like tags$p("a"),
see here