-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.R
More file actions
125 lines (118 loc) · 4.11 KB
/
server.R
File metadata and controls
125 lines (118 loc) · 4.11 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
library(shiny)
shinyServer(function(input, output) {
# Calculate the total costs and savings
dues_full_dollars <- reactive({ isolate({
round(input$monthly_salary*(input$dues_full/100)*12, 2)
})
})
dues_fair_dollars <-reactive({ isolate({
round(input$monthly_salary*(input$dues_fair/100)*12, 2)
})
})
cost_full <- reactive({ round(isolate(input$insurance_GTFF) + isolate(input$fees_paid) + dues_full_dollars(),2)
})
cost_fair <- reactive({ round(isolate(input$insurance_GTFF) + isolate(input$fees_paid) + dues_fair_dollars(),2)
})
cost_noACA <- reactive({ isolate({
round(input$insurance_ACA + input$fees_asked, 2)
})
})
cost_noGTFF <- reactive({ isolate({
round(input$insurance_UO + input$fees_asked, 2)
})
})
savings_ACA_full <- reactive({ round(cost_noACA() - cost_full(), 2)
})
savings_UO_full <- reactive({ round(cost_noGTFF() - cost_full(), 2)
})
savings_ACA_fair <- reactive({ round(cost_noACA() - cost_fair(), 2)
})
savings_UO_fair <- reactive({ round(cost_noGTFF() - cost_fair(), 2)
})
# Display values entered
output$text_salary <- renderText({
input$action_Calc
paste("Monthly Salary: [$]", isolate(input$monthly_salary))
})
output$text_dues_full <- renderText({
input$action_Calc
paste("Full Share Dues: ", isolate(input$dues_full),
" % monthly income")
})
output$text_dues_fair <- renderText({
input$action_Calc
paste("Fair Share Dues: ", isolate(input$dues_fair),
" % monthly income")
})
output$text_insurance_GTFF <- renderText({
input$action_Calc
paste("Health Insurance GTFF [$]: ", isolate(input$insurance_GTFF))
})
output$text_insurance_ACA <- renderText({
input$action_Calc
paste("Health Insurance ACA [$]: ", isolate(input$insurance_ACA))
})
output$text_insurance_UO <- renderText({
input$action_Calc
paste("Health Insurance UO [$]: ", isolate(input$insurance_UO))
})
output$text_fees_paid <- renderText({
input$action_Calc
paste("Fees Paid [$]: ", isolate(input$fees_paid))
})
output$text_fees_asked <- renderText({
input$action_Calc
paste("Fees Asked [$]: ", isolate(input$fees_asked))
})
# Display calculated values
output$text_dues_full_dollars <- renderText({
if(input$action_Calc == 0) ""
else
paste("Full Share Member Dues Per Year:", dues_full_dollars())
})
output$text_dues_fair_dollars <- renderText({
if(input$action_Calc == 0) ""
else
paste("Fair Share Member Dues Per Year:", dues_fair_dollars())
})
output$text_cost_full <- renderText({
if(input$action_Calc == 0) ""
else
paste("Total Cost Full Share Member [$]:", cost_full())
})
output$text_cost_fair <- renderText({
if(input$action_Calc == 0) ""
else
paste("Total Cost Fair Share Member [$]:", cost_fair())
})
output$text_cost_noACA <- renderText({
if(input$action_Calc == 0) ""
else
paste("Total Cost No ACA [$]:", cost_noACA())
})
output$text_cost_noGTFF <- renderText({
if(input$action_Calc == 0) ""
else
paste("Total Cost No UO Union [$]:", cost_noGTFF())
})
output$text_savings_ACA_full <- renderText({
if(input$action_Calc == 0) ""
else
paste("Savings (ACA) Full Share Member[$]:", savings_ACA_full())
})
output$text_savings_ACA_fair <- renderText({
if(input$action_Calc == 0) ""
else
paste("Savings (ACA) Fair Share [$]:", savings_ACA_fair())
})
output$text_savings_UO_full <- renderText({
if(input$action_Calc == 0) ""
else
paste("Savings (UO) Full Share Member[$]:", savings_UO_full())
})
output$text_savings_UO_fair <- renderText({
if(input$action_Calc == 0) ""
else
paste("Savings (UO) Fair Share [$]:", savings_UO_fair())
})
})