tm_file_viewer {teal.modules.general}R Documentation

teal module: File viewer

Description

The file viewer module provides a tool to view static files. Supported formats include text formats, PDF, PNG APNG, JPEG SVG, WEBP, GIF and BMP.

Usage

tm_file_viewer(
  label = "File Viewer Module",
  input_path = list(`Current Working Directory` = ".")
)

Arguments

label

(character(1)) Label shown in the navigation item for the module or module group. For modules() defaults to "root". See Details.

input_path

(list) of the input paths, optional. Each element can be:

Paths can be specified as absolute paths or relative to the running directory of the application. Default to the current working directory if not supplied.

Value

Object of class teal_module to be used in teal applications.

Examples

data <- teal_data()
data <- within(data, {
  data <- data.frame(1)
})
datanames(data) <- c("data")

app <- init(
  data = data,
  modules = modules(
    tm_file_viewer(
      input_path = list(
        folder = system.file("sample_files", package = "teal.modules.general"),
        png = system.file("sample_files/sample_file.png", package = "teal.modules.general"),
        txt = system.file("sample_files/sample_file.txt", package = "teal.modules.general"),
        url = "https://fda.gov/files/drugs/published/Portable-Document-Format-Specifications.pdf"
      )
    )
  )
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}


[Package teal.modules.general version 0.3.0 Index]