-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.r
77 lines (59 loc) · 1.51 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
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
# server.R
server <- function(input, output, session) {
# Filtered surveys ----
filter_returns <- surveyFiltersServer()
filtered_surveys <- reactive({
filter_returns$wide()
})
filtered_surveys_long <- reactive({
df <- filter_returns$long()
if (input$group_wild) {
df %>%
filter(bee_name %in% wildbee_names) %>%
droplevels()
} else {
df %>%
filter(bee_name != "Wild bees") %>%
droplevels()
}
})
# Module servers ----
# species composition pie charts
speciesCompServer(
cur_surveys_long = reactive(filtered_surveys_long())
)
# bee activity by date
activityByDateServer(
data = reactive(filtered_surveys()),
data_long = reactive(filtered_surveys_long())
)
# number of surveys by date
surveysByDateServer(
data = reactive(filtered_surveys())
)
# bee activity by date
activityByHabitatServer(
data_long = reactive(filtered_surveys_long())
)
# bee activity by management type
activityByMgmtServer(
data_long = reactive(filtered_surveys_long())
)
# bee activity by crop type
activityByCropServer(
data_long = reactive(filtered_surveys_long())
)
# map showing surveys or bee activity
activityMapServer(
data = reactive(filtered_surveys()),
data_long = reactive(filtered_surveys_long())
)
# data table
dataTableServer(
data_long = reactive(filtered_surveys_long())
)
# user stats
userStatsServer(
data = reactive(filtered_surveys())
)
}