-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathui.R
88 lines (73 loc) · 3.11 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
library(shiny)
library(shinyAce)
library(whisker)
source("R/dkdfinfo.r")
source("R/lib.r")
source("R/melanoma.r")
if (packageVersion("shiny") < "0.11")
stop("Need shiny version >= 0.11 for bootstrap 3")
# to run
# shiny:::runApp()
# shiny:::runApp("../Table1", launch.browser = rstudio::viewer)
data(iris)
# Define UI for dataset viewer application
shinyUI(fluidPage(
titlePanel("Table1"),
sidebarLayout(
sidebarPanel(
includeCSS("www/table1.css"),
includeScript("www/js/jquery-ui-1.10.3.custom.min.js"),
jsCodeHandler(),
wellPanel(
p("Table1 is an interface to the Gmisc htmlTable function for producing a typical cases vs controls Table 1.")
),
selectInput("dataset", "Dataframe:", choices = getDataFrames()),
wellPanel(
p(helpText("Select the factor variable that will produce the columns, ",
"typically the Cases vs Controls ID var."),
selectInput("colFactor","Columns Variable:", choices=getdfinfo(getDataFrames()[1])$factors$name, multiple=F)
)),
wellPanel(
p(helpText("Select the numerics and factors to include ",
"in the rows of the table.")),
selectizeInput("numerics", "Numerics:", choices=getdfinfo(getDataFrames()[1])$numerics$name, selected="", multiple=T,
options=list(placeholder="Select numeric(s)", dropdownParent = "body", plugins=list(remove_button="", drag_drop=""))),
selectizeInput("factors", "Factors:", choices=getdfinfo(getDataFrames()[1])$factors$name, selected="", multiple=T,
options=list(placeholder="Select factor(s)", dropdownParent = "body", plugins=list(remove_button="", drag_drop="")))
),
p("Options:"),
accordion("optionsAccordion",
accordionPanel("Column",
checkboxInput("chkStatistics", "Show Statistics", F),
checkboxInput("chkTotals", "Show Total Column", T),
checkboxInput("chkNEJM", "NEJM Style n (%)", T),
checkboxInput("chkColN", "N= in column header", T),
p(),
spreadsheetInput("tblColOptions", rbind(c("","","")),
colHeaders='["Name","Justify","Group"]',
options='columns: [ {}, {type: "dropdown", source: ["c","l","r"] }, {} ]')
),
accordionPanel("Row",
spreadsheetInput("tblRowOptions", rbind(c("","")), colHeaders='["Name","Digits"]'),
radioButtons("describeNumeric", "Numeric statistic:", choices=c("Mean","Median"), selected="Mean", inline=T)
),
accordionPanel("Table",
textInput("txtCaption", "Caption:"),
textInput("txtCapLoc", "Caption Location:", "top"),
textInput("txtFooter", "Footer:"),
radioButtons("radTableWidth", "Table Width", choices=c("40%","60%","80%","100%"), selected="80%")
)
) # accordion
), # end sidebarpanel
mainPanel(
tabsetPanel(id="mainPanelTabset",
tabPanel("Table",
htmlOutput("Table1")
),
tabPanel("Source",
aceEditor("acer", mode="r")
)
)
) # mainpanel
) # sidebarLayout
))