file_summary: UI for the file summary module

Description Usage Arguments Value Examples

Description

Creates the UI for the file summary module, complete with a drop-down selection box, and two tabs, one for a file overview and one for file details.

Gives functionality to the file summary UI, populating the drop-down menu with available files to choose from, and showing both an overview and detailed summary of a chosen file.

Usage

1
2
3
file_summary_ui(id)

file_summary_server(input, output, session, file_data)

Arguments

id

the id

input

the input variables from shiny::callModule()

output

the output variables from shiny::callModule()

session

the session from shiny::callModule()

file_data

a reactive, named list of file data in data frames or tibbles

Value

html UI for file summary

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
library("shiny")
library("shinydashboard")

server <- function(input, output) {
  # Create some simple file dataa
  data <- reactive({
    list(
      "individual" = data.frame(
        individualID = c("a", "b", "c"),
        age = c(23, 24, 24),
        stringsAsFactors = FALSE
      ),
      "biospecimen" = data.frame(
        individualID = c("a", "b", "c"),
        specimenID = c("a1", "b1", "c1"),
        isReal = c(FALSE, FALSE, FALSE),
        stringsAsFactors = FALSE
      )
    )
  })
  # Show file summary
  callModule(file_summary_server, "summary", file_data = data)
}

ui <- function(request) {
  dashboardPage(
    header = dashboardHeader(),
    sidebar = dashboardSidebar(),
    body = dashboardBody(
      includeCSS(
        system.file("app/www/custom.css", package = "dccvalidator")
      ),
      file_summary_ui("summary")
    )
  )
}
## Not run: 
shinyApp(ui, server)

## End(Not run)

dccvalidator documentation built on July 2, 2020, 4:05 a.m.