-
Notifications
You must be signed in to change notification settings - Fork 1
/
M1.R
49 lines (37 loc) · 914 Bytes
/
M1.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
library('shiny')
observeEvent(input$sampledata, {
data('endosim')
loadedData(endosim)
textobj(paste(textobj(),'Using the Sample Data provided by RealROC.',' ', sep='<br/>'))
})
listentofile <- reactive({list(input$main, input$sep, input$quote, input$header)})
mydata <- eventReactive(listentofile(),{
req(input$main$datapath)
read.csv(
input$main$datapath,
header = input$header,
sep = input$sep,
quote = input$quote
)
})
observeEvent(mydata(),{
loadedData(mydata())
})
observe({
req(input$main$datapath)
try({
if (file_ext(input$main$datapath) == 'csv') {
loadedData(
mydata()
)
} else {
loadedData(read_excel(input$main$datapath,
sheet = input$sheetId))
}
})
})
observeEvent(listentoDataInputs(), {
output$filetable <- renderDataTable({
DT::datatable(loadedData())
})
})