combine: Combine Statistics with Bio, Position, and DL Info

Description Usage Arguments Value Examples

View source: R/clean-data.R

Description

Takes the clean statistics (can be either actual or MLEs) and adds bio, position, and dl info

Usage

1
combine(stats, bio, pos, dl)

Arguments

stats

data.frame of player statistics. Obtained from clean_PIA()

bio

data.frame of Bio Data. Must be in proper form.

dl

data.frame of DL Time. Must be in proper form.

position

data.frame of Positions. Must be in proper form.

Value

tbl_df of statistics that have been joined with bio, pos, dl.

Examples

1
2
3
4
5
6
7
8
curr_wd <- getwd()
setwd("N:/Apps/simScoresApp/data")
stats <- read.csv("4-mles/bat-mles.csv", header = T, stringsAsFactors = F) %>% tbl_df() %>% mutate(MLBID = as.character(MLBID))
bio <- read.csv("manual-info/bio_bat.csv", header = T, stringsAsFactors = F) %>% tbl_df() %>% mutate(MLBID = as.character(MLBID))
pos <- read.csv("manual-info/positions.csv", header = T, stringsAsFactors = F) %>% tbl_df() %>% mutate(MLBID = as.character(MLBID))
dl <- read.csv("manual-info/injuries.csv", header = T, stringsAsFactors = F) %>% tbl_df() %>% mutate(MLBID = as.character(MLBID))
x <- combine(stats, bio, pos, dl)
setwd(curr_wd)

guytuori/simScores documentation built on May 17, 2019, 9:29 a.m.