Skip to contents

Convenience function that disables the user's ability to see the code of the module.

Usage

disable_src(x)

Arguments

x

(teal_module) a teal_module object.

Value

modified data object that indicates that it should not show the "Show R Code" button in the UI.

Details

This is equivalent to setting the attribute teal.enable_src to FALSE on the data object returned by the module.

See also

Examples in Shinylive

example-1

Open in Shinylive

example-2

Open in Shinylive

Examples

# Disabling source on a single module
app <- init(
  data = within(teal_data(), iris <- iris),
  modules = modules(
    example_module(label = "example teal module") |> disable_src()
  )
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}
# Multiple modules
app <- init(
  data = within(teal_data(), iris <- iris),
  modules = modules(
    example_module(label = "example 1"),
    example_module(label = "example 2")
  ) |> disable_src()
)

if (interactive()) {
  shinyApp(app$ui, app$server)
}