Hi,
I have been trying to wrap a chunk of text to be presented in a desired manner. I have tried to wrap the text in
tags$div(). But it throws me an error
library(shiny)
#> Warning: package 'shiny' was built under R version 4.0.5
ui = fluidPage(
textOutput("tx1"), tags$br(),
textOutput("tx2"), tags$br()
)
server <- function(input, output){
output$tx1 <- renderText(
tags$div("Note:
Some text 1
More text 2
")
)
output$tx2 <- renderText(
"Note:
Some text 1
More text 2
"
)
}
shinyApp(ui, server)
#>
#> Listening on http://127.0.0.1:7386
#> Warning: Error in cat: argument 1 (type 'list') cannot be handled by 'cat'
I am getting -
Error in cat: argument 1 (type 'list') cannot be handled by 'cat'
and
Note: Some text 1 More text 2
I want to the output to be shown as -
Note:
Some text 1
More text 2
Is there a way I can achieve my desired output?
Thanks.