/
ui.R
91 lines (87 loc) · 2.34 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
library(shiny)
library(ggplot2)
source("chooser.R")
shinyUI(navbarPage(
title = 'Shiny Wrangler',
tabPanel('Load data set',
fluidRow(
column(3,
wellPanel(
fileInput('file1', 'Choose file to upload',
accept = c(
'text/csv',
'text/comma-separated-values',
'text/tab-separated-values',
'text/plain',
'.csv',
'.tsv'
)
),
hr(),
checkboxInput('header', 'Header', TRUE),
wellPanel(
radioButtons('sep', 'Separator',
c(Comma=',',
Semicolon=';',
Tab='\t'),
',')
),
wellPanel(
radioButtons('quote', 'Quote',
c(None='',
'Double Quote'='"',
'Single Quote'="'"),
'"')
),
hr(),
p('If you want a sample .csv or .tsv file to upload,',
'you can first download the sample',
a(href = 'mtcars.csv', 'mtcars.csv'), 'or',
a(href = 'pressure.tsv', 'pressure.tsv'),
'files, and then try uploading them.'
)
)
),
column(8,
dataTableOutput('view')
)
)
),
tabPanel('Reshape Data',
fluidRow(
column(2, h3("Untidy Columns")),
column(2, h3("Tidy Columns"))
),
fluidRow(
column(4,uiOutput("chooser")),
column(3, textInput("varName", "Name for variable column", value = "Variable"),
textInput("valueName", "Name for value column", value = "Value"))
),
actionButton("melt", "Melt Data"),
br(),
hr(),
br(),
fluidRow(
column(3, uiOutput("colOutput")),
column(3, uiOutput("cellOutput"))
),
actionButton("cast", "Cast Data"),
br(),
hr(),
dataTableOutput("view2")
),
tabPanel('Download data',
fluidRow(
column(3,
textInput("fileName", "Save as:"),
helpText("Note: you do not need to write a file extension above"),
radioButtons("filetype", "File type:",
choices = c("csv", "tsv")),
downloadButton('downloadData', 'Download')
),
column(8,
dataTableOutput("view3")
)
)
)
))