Using the source command in Rshiny without TRUE evaluation

Viewed 818

When making larger applications in RShiny I like to keep my code in separate files for separate tabs or menus. When I place RShiny commands within a .R file and call it using the source() command, a TRUE is printed below the UI element. I have tried calling source in both ui.R and using uiOutput() as well as invisible().

How do I stop the TRUE rendering?

Example:

app.R

library(shiny)

ui <- fluidPage(h4("Attempt 1"),
                source("TestSource.R",local=T),
                h4("Attempt 2"),
                uiOutput("at2"),
                h4("Attempt 3"),
                invisible(source("TestSource.R")))

server <- function(input, output) {
  output$at2 <- renderUI({
    invisible(source(
      "TestSource.R",
      verbose = F,
      echo = F,
      print.eval = F,
      prompt.echo = F,
      local = T
    ))
  })
}

shinyApp(ui = ui, server = server)

TestSource.R

helpText("This is a test")

Here is what this renders

An example output

Thanks in advance.

2 Answers
Related