-
Notifications
You must be signed in to change notification settings - Fork 35
/
ui.R
73 lines (65 loc) · 2.59 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
# Import R packages needed for the UI
library(shiny)
library(shinycssloaders)
library(DT)
# Begin UI for the R + reticulate example app
ui <- fluidPage(
titlePanel('Example app: Using R Shiny + reticulate'),
sidebarLayout(
# ---------------- Sidebar panel with changeable inputs ----------------- #
sidebarPanel(
h4('Inputs to pure R functions'),
radioButtons('dist',
'Distribution type:',
choices = c('Normal' = 'norm',
'Uniform' = 'unif',
'Log-normal' = 'lnorm',
'Exponential' = 'exp')),
br(),
sliderInput('n',
'Number of observations:',
value = 5000,
min = 100,
max = 10000),
hr(),
h4('Inputs to Python functions called by reticulate'),
textInput('str',
'Text to display',
value = 'This text is being printed by a Python function!'),
numericInput('x',
'x value',
value = 1),
numericInput('y',
'y value',
value = 2)
),
# ---------------- Sidebar panel with changeable inputs ----------------- #
mainPanel(
# Output: Tabset w/ plot, summary, and table ----
tabsetPanel(type = 'tabs',
tabPanel('Using R and Python functions',
br(),
h3('Outputs generated with pure R'),
br(),
withSpinner(plotOutput('plot')),
br(),
h3('Outputs generated by Python functions via reticulate'),
verbatimTextOutput('message'),
br(),
'Use the numpy Python package to add two numbers',
verbatimTextOutput('xy')),
tabPanel('Architecture Info',
h3('Current architecture info'),
'(These values will change when app is run locally vs on Shinyapps.io)',
hr(),
withSpinner(DT::dataTableOutput('sysinfo')),
br(),
verbatimTextOutput('which_python'),
verbatimTextOutput('python_version'),
verbatimTextOutput('ret_env_var'),
verbatimTextOutput('venv_root')
)
)
)
)
)