FilePsInput: FilePsInput: Shiny module UI for file upload for propensity...

Description Usage Arguments Details Value Examples

View source: R/FilePsInput.R

Description

Shiny module UI for file upload for propensity score matching.

Usage

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

Arguments

id

id

label

label, Default: 'csv/xlsx/sav/sas7bdat file'

Details

Shiny module UI for file upload for propensity score matching.

Value

Shiny module UI for file upload for propensity score matching.

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
library(shiny);library(DT);library(data.table);library(readxl);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", width = "100%"))
                 )
   )
 )
)

server <- function(input, output, session) {
  mat.info <- callModule(FilePs, "datafile")

  output$data <- renderDT({
    mat.info()$data
  })

  output$matdata <- renderDT({
    mat.info()$matdata
  })

  output$label <- renderDT({
    mat.info()$label
  })
}

Example output

Registered S3 method overwritten by 'GGally':
  method from   
  +.gg   ggplot2
Registered S3 methods overwritten by 'lme4':
  method                          from
  cooks.distance.influence.merMod car 
  influence.merMod                car 
  dfbeta.influence.merMod         car 
  dfbetas.influence.merMod        car 

Attaching package:DTThe following objects are masked frompackage:shiny:

    dataTableOutput, renderDataTable

jsmodule documentation built on Oct. 11, 2021, 9:07 a.m.