Learn R Programming

jsmodule (version 1.6.11)

FilePsInput: FilePsInput: Shiny module UI for propensity score analysis.

Description

Provides a file input and UI outputs for options related to propensity score matching.

Usage

FilePsInput(id, label = "Upload data (csv/xlsx/sav/sas7bdat/dta)")

Value

A Shiny UI object.

Arguments

id

A string, the module id.

label

A string, the label for the file input.

Examples

Run this code
if (interactive()) {
  library(shiny)
  library(DT)
  library(jstable)

  ui <- fluidPage(
    sidebarLayout(
      sidebarPanel(
        FilePsInput("datafile")
      ),
      mainPanel(
        tabsetPanel(
          type = "pills",
          tabPanel("Data", DTOutput("data")),
          tabPanel("Matching data", DTOutput("matdata")),
          tabPanel("Label", DTOutput("data_label"))
        )
      )
    )
  )

  server <- function(input, output, session) {
    mat_info <- callModule(FilePs, "datafile")

    output$data <- renderDT({ mat_info()$data })
    output$matdata <- renderDT({ mat_info()$matdata })
    output$data_label <- renderDT({ mat_info()$label })
  }
  shinyApp(ui, server)
}

Run the code above in your browser using DataLab