forked from rstudio/shiny-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui.R
31 lines (30 loc) · 878 Bytes
/
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
library(shiny)
library(ggplot2) # for the diamonds dataset
fluidPage(
title = 'Examples of DataTables',
sidebarLayout(
sidebarPanel(
conditionalPanel(
'input.dataset === "diamonds"',
checkboxGroupInput('show_vars', 'Columns in diamonds to show:',
names(diamonds), selected = names(diamonds))
),
conditionalPanel(
'input.dataset === "mtcars"',
helpText('Click the column header to sort a column.')
),
conditionalPanel(
'input.dataset === "iris"',
helpText('Display 5 records by default.')
)
),
mainPanel(
tabsetPanel(
id = 'dataset',
tabPanel('diamonds', DT::dataTableOutput('mytable1')),
tabPanel('mtcars', DT::dataTableOutput('mytable2')),
tabPanel('iris', DT::dataTableOutput('mytable3'))
)
)
)
)