Learn R Programming

teal (version 1.1.0)

disable_src: Disable the "Show R Code" global button in the UI

Description

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

Usage

disable_src(x)

Value

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

Arguments

x

(teal_module) a teal_module object.

Examples in Shinylive

example-1

Open in Shinylive

example-2

Open in Shinylive

Details

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

See Also

disable_report()

Examples

Run this code
# 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)
}

Run the code above in your browser using DataLab