forked from bbahar/method_compare
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathui.R
125 lines (122 loc) · 5.33 KB
/
ui.R
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
library(shiny)
library(mcr)
library(shinydashboard)
library(rhandsontable)
library(rmarkdown)
dashboardPage(
dashboardHeader(title = "Binary Classification"),
dashboardSidebar(
sidebarMenu(
menuItem("Information", tabName = "info",
icon = icon("info", "fa-lg")
),
menuItem("Data", tabName = "data_input",
icon = icon("table", "fa-lg")
),
menuItem("Sens and Spec", tabName = "sensandspec",
icon = icon("calculator", "fa-lg")),
menuItem("Download", tabName = "download",
icon = icon("download", "fa-lg")
)
)
),
dashboardBody(
tabItems(
#info
{tabItem(tabName = "info",
# Need to write this part providing explanation what this website is used for...
h4('References and packages:'),
h5("1. R: A language and environment for statistical computing.
R Foundation for Statistical Computing, Vienna, Austria.",
a('https://www.R-project.org',
href = "https://www.R-project.org")),
h5("2. shiny: Web Application Framework for R.",
a("http://CRAN.R-project.org/package=shiny",
href = "http://CRAN.R-project.org/package=shiny")),
h5("3. shinydashboard: Create Dashboards with 'Shiny'.",
a('http://rstudio.github.io/shinydashboard',
href = "http://rstudio.github.io/shinydashboard")),
h5("4. pander: An R Pandoc Writer.",
a('http://rapporter.github.io/pander',
href = "http://rapporter.github.io/pander")),
h5("5. rmarkdown: Dynamic Documents for R.",
a('http://rmarkdown.rstudio.com',
href = "http://rmarkdown.rstudio.com")),
br(),
h4('For any questions or concerns please contact:',
a("Burak Bahar, MD", href = "mailto:[email protected]"))
)},
tabItem(tabName = "data_input",
box(title = "Contingency Calculator", width= 10, status = 'info',
#Row 1 houses 'comparative method' text
fluidRow(
column(width = 6, offset = 3, h4(tags$strong("Comparitive method")))
),
#Row 2 houses 'candidate method', 'pos'., 'neg'., and 'tot.'
fluidRow(
column(3, h4(tags$strong(("Candidate Method")))),
column(3, h4("Positive")),
column(3, h4("Negative")),
column(3, h4(tags$em("Total")))),
#Row 3
fluidRow(
column(3, h4("Positive")),
column(3, numericInput(inputId = "TP", label = NULL, value = NULL)),
column(3, numericInput(inputId = "FP", label = NULL, value = NULL)),
column(3, textOutput("totposcand"))),
#Row 4
fluidRow(
column(3, h4("Negative")),
column(3, numericInput(inputId = "FN", label = NULL, value = NULL)),
column(3, numericInput(inputId = "TN", label = NULL, value = NULL)),
column(3, textOutput("totnegcand"))),
#Row 5
fluidRow(
column(3, h4(tags$em("Total"))),
column(3, textOutput("totposcomp")),
column(3, textOutput("totnegcomp")),
column(3, textOutput("tottest")))
)
),
tabItem(tabName = "sensandspec",
box(title = "Output", width= 10,
#Row 1
fluidRow(
column(width = 2, offset = 5, h4("Percent")),
column(width = 2, h4("Lo Limit")),
column(width = 2, h4("Hi Limit"))
),
#Row 2
fluidRow(
column(width = 5, h4("Positive agreement/Sensitivity")),
column(width = 2, verbatimTextOutput("sens")),
column(width = 2, verbatimTextOutput("sens_lo")),
column(width = 2, verbatimTextOutput("sens_hi"))
),
#Row 3
fluidRow(
column(width = 5, h4("Negative agreement/Specificity")),
column(width = 2, verbatimTextOutput("spec")),
column(width = 2, verbatimTextOutput("spec_lo")),
column(width = 2, verbatimTextOutput("spec_hi"))
),
#Row 4
fluidRow(
column(width = 5, h4("Overall agreement")),
column(width = 2, verbatimTextOutput("overall")),
column(width = 2, verbatimTextOutput("overall_lo")),
column(width = 2, verbatimTextOutput("overall_hi"))
)
)
),
tabItem(tabName = "download",
box(title = "Download Report", status = 'info',
radioButtons('format', h5('Document format'),
c('PDF', 'HTML'),
inline = TRUE),
downloadButton('downloadReport')
)
)
)
)
)