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 ui.R and server.R .
let's say I wanted to get the results of a t-test and have a separate line for 't', 'df' and 'p-value'
I am using a shinydashboard layout.
sample data
Group_A <- 1:13 Group_B <- 8:19
Ui
box(title = "T-test results:", status = "primary", textOutput("text3"), width=3)
Server
output$text3 <- renderPrint({ obj <- t.test(Group_A, Group_B) cat("t = ", round(obj[[3]],3), "\n, df = ", round(obj[[2]],3), "\n, p-value = ", round(obj[[3]],5)) })
This output is shown in the image below:

As you can see, the output on the screen from left to right is separated by a comma. Since I want to add some results, I would like them to go top down on the screen with a line break after each value.
Does anyone know how to do this in shiny ?
source share