I am just trying to write output to a textOutput but I don't want it responding to any reactives - I want total control of when I update the text (for notifications: I want to basically write some log messages based on backend processing to the screen).
If I add: verbatimTextOutput("txt") in my ui.R and then try to do:
observeEvent(input$someButton, {
... # do some work
output$txt <- "some text" #Error: see below
... # do some more work
})
I am getting Warning: Unhandled error in observer: Unexpected character output for txt
ADDED: reproducible example:
server <- function(input, output) {
observeEvent(input$doBtn, {
#... do some work
output$txt <- "some text" #crashes app.
#... do some more work
})
output$distPlot <- renderPlot({
hist(rnorm(input$obs), col = 'darkgray', border = 'white')
})
}
ui <- shinyUI(fluidPage(
mainPanel(
verbatimTextOutput("txt"),
actionButton("doBtn", "Do something")
)
))
shinyApp(ui = ui, server = server)
Is it even possible to directly reference a text output element in this way, without wrapping it in its own render* function? I don't think I can take the error message too literally because the text being updated is very simple. And yes I am aware of withProgress() etc but that is not what I want in this case.
Thank you.
renderTextorrenderUI. - cdeterman