-
Notifications
You must be signed in to change notification settings - Fork 0
/
reddit-post.R
117 lines (112 loc) · 3.31 KB
/
reddit-post.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
library(tidyverse)
library(knitr)
# Get data
top_players <- read_csv("results/top_players.csv")
top_stats <- read_csv("results/top_stats.csv")
top_prefixes <- read_csv("results/top_prefixes.csv")
top_suffixes <- read_csv("results/top_suffixes.csv")
for (role in unique(top_players$player_role)) {
# Top player tables
top_players %>%
filter(player_role == role) %>%
mutate(points = paste0(round(average), " (±", round(stddev), ")")) %>%
select(player_name, team_name, points) %>%
kable(
format = "pipe",
digits = 0,
col.names = c("Player", "Team", "Points"),
align = "llr",
caption = paste0(
"The top scoring ", role, " players, format: ",
"Average (Standard Deviation)"
)
) %>%
print()
# Top stat tables
top_stats %>%
filter(player_role == role) %>%
mutate(
all_player_points = paste0(
round(all_player_average),
" (±",
round(all_player_stddev),
")"
),
top_player_points = paste0(
round(top_player_average),
" (±",
round(top_player_stddev),
")"
)
) %>%
select(emblem_colour, emblem_stat, all_player_points, top_player_points) %>%
kable(
format = "pipe",
digits = 0,
col.names = c("Colour", "Stat", "All Players", "Top 25% Players"),
align = "llrr",
caption = paste0(
"The top War Banner Emblem Stats for ", role, " players, format: ",
"Average (Standard Deviation)"
)
) %>%
print()
# Top prefix tables
top_prefixes %>%
filter(player_role == role) %>%
mutate(
all_player_bonus = paste0(
format(round(all_player_bonus, 2), nsmall = 2, trim = TRUE),
"% (",
format(round(all_player_prob * 100, 2), nsmall = 2, trim = TRUE),
"%)"
),
top_player_bonus = paste0(
format(round(top_player_bonus, 2), nsmall = 2, trim = TRUE),
"% (",
format(round(top_player_prob * 100, 2), nsmall = 2, trim = TRUE),
"%)"
)
) %>%
select(prefix_name, prefix_desc, all_player_bonus, top_player_bonus) %>%
kable(
format = "pipe",
digits = 2,
col.names = c("Prefix", "Description", "All Players", "Top 25% Players"),
align = "llrr",
caption = paste0(
"The top Title Prefixes for ", role, " players, format: ",
"Effective Bonus (Probability)"
)
) %>%
print()
# Top suffix tables
top_suffixes %>%
filter(player_role == role) %>%
mutate(
all_player_bonus = paste0(
format(round(all_player_bonus, 2), nsmall = 2, trim = TRUE),
"% (",
format(round(all_player_prob * 100, 2), nsmall = 2, trim = TRUE),
"%)"
),
top_player_bonus = paste0(
format(round(top_player_bonus, 2), nsmall = 2, trim = TRUE),
"% (",
format(round(top_player_prob * 100, 2), nsmall = 2, trim = TRUE),
"%)"
)
) %>%
select(suffix_name, suffix_desc, all_player_bonus, top_player_bonus) %>%
kable(
format = "pipe",
digits = 2,
col.names = c("Suffix", "Description", "All Players", "Top 25% Players"),
align = "llrr",
caption = paste0(
"The top Title Suffixes for ", role, " players, format: ",
"Effective Bonus (Probability)"
)
) %>%
print()
}