-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevante-data-overview.qmd
More file actions
148 lines (115 loc) · 2.96 KB
/
levante-data-overview.qmd
File metadata and controls
148 lines (115 loc) · 2.96 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
---
format: dashboard
theme: [cosmo, theme.scss]
preview:
port: 4200
---
```{r}
#| label: setup
library(tidyverse)
library(redivis)
.font <- "Whitney"
theme_set(theme_bw(base_size = 14, base_family = .font))
theme_update(panel.grid = element_blank(),
strip.background = element_blank(),
legend.key = element_blank(),
panel.border = element_blank(),
axis.line = element_line(),
strip.text = element_text(face = "bold"))
pal <- list(primary = "#f7ca69", secondary = "#69F7CA", tertiary = "#CA69F7",
light = "#9c9c9c")
```
```{r}
#| label: load-data
runs_processed <- redivis$user("mikabr")$
workflow("levante_data_overview:gy1z")$
table("runs_processed")$
to_tibble()
runs <- runs_processed |>
mutate(site = dataset |> str_remove("_pilot") |> fct_infreq(),
task_id = task_id |> fct_infreq())
```
```{r}
#| label: all-values
display_vals <- list(
n_sites = runs |> distinct(site) |> nrow(),
n_tasks = runs |> distinct(task_id) |> nrow(),
n_users = runs |> distinct(user_id) |> nrow(),
n_runs = runs |> distinct(user_id, run_id) |> nrow()
)
```
## Row {height="25%"}
```{r}
#| content: valuebox
#| title: "Sites"
list(
icon = "globe",
color = pal$secondary,
value = display_vals$n_sites
)
```
```{r}
#| content: valuebox
#| title: "Participants"
list(
icon = "person-arms-up",
color = pal$primary,
value = display_vals$n_users
)
```
```{r}
#| content: valuebox
#| title: "Assessments"
list(
icon = "clipboard-data",
color = pal$tertiary,
value = display_vals$n_runs
)
```
## Row {height="75%"}
### Column {width="50%"}
### Row {.tabset}
```{r}
#| title: "Participants by site"
ggplot(runs |> distinct(site, user_id), aes(y = site)) +
geom_bar(fill = pal$primary) +
scale_x_continuous(expand = c(0, 0)) +
labs(x = "Number of participants", y = "")
```
```{r}
#| title: "Assessments by site"
ggplot(runs |> distinct(site, run_id), aes(y = site)) +
geom_bar(fill = pal$tertiary) +
scale_x_continuous(expand = c(0, 0)) +
labs(x = "Number of assessments", y = "")
```
```{r}
#| title: "Ages by site"
ggplot(runs, aes(x = age, fill = site)) +
geom_histogram(binwidth = 1) +
scale_y_continuous(expand = c(0, 0)) +
labs(x = "Age (years)", y = "Number of assessments")
```
### Column {width="50%"}
### Row {.tabset}
```{r}
#| title: "Participants by task"
ggplot(runs |> distinct(task_id, user_id), aes(y = task_id)) +
geom_bar(fill = pal$primary) +
scale_x_continuous(expand = c(0, 0)) +
labs(x = "Number of participants", y = "")
```
```{r}
#| title: "Assessments by task"
ggplot(runs |> distinct(task_id, run_id), aes(y = task_id)) +
geom_bar(fill = pal$tertiary) +
scale_x_continuous(expand = c(0, 0)) +
labs(x = "Number of assessments", y = "")
```
```{r}
#| title: "Ages by task"
ggplot(runs, aes(x = age, fill = task_id)) +
geom_histogram(binwidth = 1) +
scale_y_continuous(expand = c(0, 0)) +
labs(x = "Age (years)", y = "Number of assessments")
```