-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.R
131 lines (126 loc) · 5 KB
/
app.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
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
126
127
128
129
130
131
source("data_cleaning.R")
thematic_shiny()
ui <- page_fluid(
theme = bs_theme(preset = "minty"),
headerPanel("Table 3 - Characteristics of included studies"),
reactableOutput("table3"),
textInput("footnote", "Note. RCT: Randomised controlled trial. QE: Quasi-experimental. NE: Non-experimental. Nr: Not reported. SEM: Structural equation modelling.",
width = "100%")
)
server <- function(input, output) {
output$table3 <- renderReactable({
reactable(Table3,
theme = default(centered = TRUE),
filterable = TRUE,
bordered = FALSE,
striped = FALSE,
highlight = TRUE,
searchable = TRUE,
defaultPageSize = 16,
columns = list(
Study_ID = colDef(
align = "center",
name = "Study ID",
cell = function(value, index) {
label1 <- DOITable[index, "Study_ID"]
# had to create a separate file for the DOIs to
# be read because I kept failing to get them using Table 3
DOI <- DOITable[index, "DOI"]
htmltools::div(
htmltools::p(
htmltools::tags$a(href = DOI,
target = "_blank",
label1)
),
)
}
),
DOI = colDef(
show = FALSE
),
"First Author" = colDef(
align = "left"
),
Year = colDef(
align = "center"
),
Country = colDef(
),
CountryFlag = colDef(
name = "",
maxWidth = 70,
align = "center",
cell = embed_img("Country",
height = "25",
width = "40")),
Design = colDef(
align = "center"
),
"Student Sample Size" = colDef(
align = "center",
minWidth = 160,
cell = data_bars(Table3,
text_position = "outside-end",
round_edges = TRUE,
box_shadow = TRUE,
bar_height = 15)
),
"Mean Age (years)" = colDef(
header = with_tooltip("Mean Age",
"Mean age in years"),
na = "–",
align = "center",
minWidth = 90,
cell = data_bars(Table3,
text_position = "center",
round_edges = TRUE,
box_shadow = TRUE,
bar_height = 15)
),
"Age Range (years)" = colDef(
header = with_tooltip("Age Range",
"Age range in years"),
na = "–",
align = "center",
minWidth = 90
),
Programme = colDef(
header = with_tooltip("Programme",
"Programme being delivered"),
align = "left",
minWidth = 220),
"Implementation Dimensions" = colDef(
name = "Implementation Dimensions (IDs)",
align = "left",
minWidth = 250),
"Length of Intervention Period (months)" = colDef(
header = with_tooltip("Duration",
"Length of intervention period in years"),
align = "center",
cell = data_bars(Table3,
text_position = "center",
round_edges = TRUE,
box_shadow = TRUE,
bar_height = 15)
),
"Number of Implementation Dimensions" = colDef(
header = with_tooltip("Number of IDs",
"Number of Implementation Dimensions"),
align = "center",
minWidth = 125,
cell = data_bars(Table3,
text_position = "center",
round_edges = TRUE,
box_shadow = TRUE,
bar_height = 15)
),
"Statistical Test" = colDef(
align = "left",
minWidth = 120
)
)
)
})
}
# Run the application
shinyApp(ui = ui, server = server)