-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.R
49 lines (35 loc) · 1.29 KB
/
server.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)
library(ggplot2)
library(psycho)
# Run rsconnect::deployApp()
shinyServer(function(input, output) {
# --------------------------------------------------------------------------
compute.assessement <- reactive({
result <- assess(patient=input$patient,
mean=input$mean,
sd=input$sd,
n=input$n,
color_controls=input$color_controls,
color_CI=input$color_CI,
color_score=input$color_score,
alpha_controls=input$alpha_controls,
alpha_CI=input$alpha_CI)
return(result)
})
#---------------------------------------------------------------------------
output$plot <- renderPlot({
# Get the current regression data
result <- compute.assessement()
plot(result) + theme(aspect.ratio = 2 / (1 + sqrt(5)))
})
#-----------------------------------------------------------------------
output$text <- renderPrint({
result <- compute.assessement()
print(result)
})
# output$download.plot <- downloadHandler(
# filename = function() {paste("dupa", '.png', sep='') },
# content = function(file) {
# ggsave(filename, plot = plot(compute.assessement()), device = "png")
# })
})