-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmetacalc.Rmd
67 lines (47 loc) · 1.15 KB
/
metacalc.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
---
title: "Calculator Log Meta Analysis"
author: Tan
---
```{r warning=FALSE}
library(DBI)
library(odbc)
library(tidyverse)
library(hrbrthemes)
aws_db <- dbConnect(odbc(),'dynastyprocess_db')
calculator_logs <- dbGetQuery(aws_db,'SELECT * FROM dp_calculatorlogs')
df_calc <- calculator_logs
dbDisconnect(aws_db)
```
```{r}
calc_types <- calculator_logs %>%
count(input_calctype)
calc_types
```
```{r}
draft_types <- calculator_logs %>%
count(input_drafttype)
draft_types
```
```{r}
qb_type <- calculator_logs %>%
count(input_qb)
qb_type
```
```{r}
calculator_logs %>%
# count(input_valuefactor) %>%
mutate(input_teams = parse_number(input_teams),
trade_diffs = abs(teamA_total-teamB_total),
trade_pct = pmap_dbl(list(trade_diffs,teamA_total,teamB_total),~..1/min(..2,..3))) %>%
filter(trade_diffs <= 10000,is.finite(trade_pct)) %>%
# filter(trade_pct <=1) %>%
ggplot() +
geom_step(aes(trade_pct),stat = 'ecdf',color = 'green',size = 1) +
coord_cartesian(xlim = c(0,1))+
# xlim(c(0,1))+
# geom_line(aes(x = ecdf(df$trade_diffs))) +
# geom_bar(aes(x = ecdf(trade_diffs))) +
theme_modern_rc()
```
```{r}
```