-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.R
39 lines (35 loc) · 1.12 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
shinyServer(function(input, output, session) {
output$clients<-renderValueBox({
x_temp<-dataframe(DataFrame)
x<-subset(x_temp, format.Date(date, "%m")==input$monthsel)
valueBox(
value=sum(x$clients),
subtitle="Number of clients:",
icon=icon("chart-area"),
)
})
output$histogram<-renderPlot({
x_temp
x<-subset(x_temp, format.Date(date, "%m")==input$monthsel)
ggplot(data=x,
aes(format(date, "%Y-%m"),y=clients)) +
geom_bar(stat = "sum", fill="blue")+
theme_minimal()+
labs(x="Month")
})
output$timeseries<- renderPlotly({
x_temp
short.date = strftime(x_temp$date, "%Y/%m")
dfx = aggregate(x_temp$clients ~ short.date, FUN = sum)
plot1<-plot_ly(
x=dfx$short.date,
y=dfx$`x_temp$clients`,
type='scatter',
mode='lines'
)
})
poll_server("main")
read_results_server("results")
food_server("main")
food_results_server("results")
})