-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.qmd
72 lines (56 loc) · 1.33 KB
/
index.qmd
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
---
title: "ggradar Example"
format: revealjs
author: "Majid Zaremehrjardy"
date: " `r format(Sys.time(), '%B %d, %Y')`"
---
## Libraries and data setup
Create a test data...
```{r, echo=TRUE}
library(ggradar)
library(tidyverse)
set.seed(123)
# Create data: note in High school for Jonathan:
data <- data.frame(
month = rep(month.name, 3),
p_value = rnorm(36, mean = 0.2, sd = 0.1),
group = c(rep('A', 12), rep('B', 12), rep('C', 12))
)
```
## Data setup part II
```{r, echo=TRUE}
data$month <- factor(data$month, levels = month.name)
max_number <- ceiling(max(data$p_value, na.rm = T) * 10) / 10
data <- data %>%
pivot_wider(
names_from = month,
values_from = p_value
)
data <- rbind(data, c("p-value = 0.05", rep(0.05, 12)))
data <- data %>% mutate_at(.vars = 2:13, .funs = as.numeric)
```
## ggradar code
<div style="font-size: 28px;">
<!-- Set your desired font size here -->
::: columns
::: {.column width="40%"}
1. Code
```{r, echo=TRUE}
g <- ggradar(data,
grid.max = max_number,
grid.mid = max_number / 2,
gridline.mid.colour = "grey",
gridline.max.linetype = "solid",
legend.position = "right",
values.radar = c(0, max_number/2, max_number),
group.point.size = NA
)
```
:::
::: {.column width="60%"}
2. Print the plot
```{r, echo=T}
plot(g)
```
:::
:::