Description Usage Arguments Value Examples
Identifies player-seasons for which the player's position is missing
1 | identify_missing_positions(dat, ignore)
|
dat |
data.frame containing MLBID, Year, and Position columns. Obtained
from |
ignore |
data.frame. This contains MLBID that the user wants to ignore when identifying missing data. Must be a data.frame with a column named MLBID |
a data.frame containing the MLBID and Year in which the Player's Position is missing.
1 2 3 4 5 6 7 8 9 10 | 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))
ignore <- read.csv("manual-info/players_to_ignore.csv", header = T, stringsAsFactors = F) %>% tbl_df() %>% mutate(MLBID = as.character(MLBID))
x <- combine(stats, bio, pos, dl)
m2 <- identify_missing_positions(x, ignore)
setwd(curr_wd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.