-
Notifications
You must be signed in to change notification settings - Fork 0
/
for_replacing_teams.Rmd
84 lines (59 loc) · 1.63 KB
/
for_replacing_teams.Rmd
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
---
title: "scratch_paper_for_updating_team_quals_initials"
author: "Raymond Lee"
date: "2023-12-07"
output: html_document
---
```{r}
(top12s <- read.csv("data/team_country_qualified_individuals.csv"))
unique(top12s$Country[top12s$Gender == "m"])
```
```{r}
alts <- readRDS("data/alt36m.rds")
intersect(alts$X, top12s$ID)
```
```{r}
alts <- readRDS("data/alt36w.rds") %>% arrange(Country)
intersect(alts$X, top12s$ID)
```
```{r}
m36csv <- read.csv("data/mens_36_athletes.csv")
saveRDS(m36csv, "data/alt36m.rds")
```
```{r}
long_meanstds <- read.csv("data/long_meanstds.csv")
men_countries <- c("JPN", "USA", "GBR", "CAN", "GER", "ITA", "SUI", "CHN", "ESP", "UKR", "TUR", "NED")
women_countries <- c("USA", "GBR", "CAN", "BRA", "ITA", "CHN", "JPN", "FRA", "KOR", "AUS", "NED", "ROU")
men_apps <- c("VT", "FX", "HB", "PB", "PH", "SR")
women_apps <- c("VT", "BB", "UB", "FX")
long_meanstds[long_meanstds$Gender == "w" &
!(long_meanstds$Country %in% women_countries) &
long_meanstds$App == "BB", ] %>% arrange(-Mean)
```
```{r}
means_wide <- read.csv("data/means_per_app.csv")
means_wide[means_wide$Gender == "m", c("ID", "Gender", "Country", "VT", "FX", "SR", "PB", "HB", "PH")]
```
```{r}
(optimized_teams <- readRDS("data/optimized_teams.rds"))
```
```{r}
(opt_mens <- readRDS("data/best.teams.mens.rds")[[1]])
```
```{r}
(opt_womens <- readRDS("data/best.teams.womens.rds")[[1]] )
```
```{r}
library(tidyverse)
library(dplyr)
opt_womens[opt_womens$Gender == "m", ]
```
```{r}
men_best[[1]]
```
```{r}
new_optimized <- rbind(opt_mens, opt_womens)
```
```{r}
saveRDS(new_optimized, "data/optimized_teams.rds")
```