-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.R
More file actions
50 lines (42 loc) · 1.99 KB
/
ui.R
File metadata and controls
50 lines (42 loc) · 1.99 KB
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
#
# This is the user-interface of the OGI machine learning component
#
#The above is a graphql a query to get all datasets from statistics.gov.scot
q <- '{datasets(and:{ componentValues:
[{component: \"http://purl.org/linked-data/sdmx/2009/dimension#refArea\"
level: \"http://statistics.gov.scot/def/geography/collection/dz-2001\"} ]
} )
{schema uri title }}'
source('runQuery.R')
result<-runQuery(q)
# Define UI for ML application
ML_ui <- shinyUI(fluidPage(
# Define the application title
titlePanel("Dataset selection"),
#define the layout of the UI (one sidebar panel and one menupanel)
sidebarLayout(
#sidebar panel is about selecting the response variable
sidebarPanel(
width = 4,
#dropdown list to select the response variable
selectizeInput(
'var', 'Please select a response variable', result$data.datasets.schema,
options = list(
placeholder = 'Response variable',
onInitialize = I('function() { this.setValue(""); }')
)
)
#dropdown list to select the reference period of the repsonse variable
,uiOutput("yearCB"),
uiOutput("actionbutton")
),
#mainpanel is about (1) selecting the predictors and (2) presenting the lasso plots
mainPanel(
uiOutput("xdatasets"), #Based on the selection of time values this presents compatible datasets
uiOutput("actionbutton2"),
hr(),
plotOutput("plot"), #This presents (1) the Lambda-Coefficients plot and (2) the Lambda - MSE Error plot
verbatimTextOutput("vars"), #This presents Lowest MSE value along with the number of variables
verbatimTextOutput("vars2") #This presents 1 Standard Error value along with the number of variables
)
)))